]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: hw - fix snd_pcm_hw_state()
authorJaroslav Kysela <perex@perex.cz>
Tue, 25 May 2021 13:29:22 +0000 (15:29 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 25 May 2021 13:30:45 +0000 (15:30 +0200)
The pcm status function should not return an error code.
Return always only the mmaped status.

Fixes: https://github.com/alsa-project/alsa-lib/issues/137
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_hw.c

index 6382b7a0c17f133933c18303c6700e174c7972d5..b38dcb5fc914c28a949bf01add05665e4652921b 100644 (file)
@@ -600,9 +600,9 @@ static int snd_pcm_hw_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
 static snd_pcm_state_t snd_pcm_hw_state(snd_pcm_t *pcm)
 {
        snd_pcm_hw_t *hw = pcm->private_data;
-       int err = query_status_data(hw);
-       if (err < 0)
-               return err;
+       /* no error checking, the mmap state should be correct
+        * after SNDRV_PCM_IOCTL_SYNC_PTR */
+       query_status_data(hw);
        return (snd_pcm_state_t) hw->mmap_status->state;
 }