From 2c8e31f50906fb51bcd16336886dc1b77b1208c8 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 25 May 2021 15:29:22 +0200 Subject: [PATCH] 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 --- src/pcm/pcm_hw.c | 6 +++--- 1 file 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; }