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>
This commit is contained in:
Jaroslav Kysela 2021-05-25 15:29:22 +02:00
parent 6b72840569
commit 2c8e31f509

View 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;
}