summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2021-05-25 15:29:22 +0200
committerJaroslav Kysela <perex@perex.cz>2021-05-25 15:30:45 +0200
commit2c8e31f50906fb51bcd16336886dc1b77b1208c8 (patch)
tree68578d0da6b6ffe659e631e2c41ed500e8ccb90c
parent6b728405697e38339773a6901ca8f557c89f0088 (diff)
downloadalsa-lib-2c8e31f50906fb51bcd16336886dc1b77b1208c8.tar.gz
pcm: hw - fix snd_pcm_hw_state()
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>
-rw-r--r--src/pcm/pcm_hw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 6382b7a0..b38dcb5f 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -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;
}