mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-06 04:06:34 -05:00
pcm: hw - fix again snd_pcm_hw_state() when the driver was disconnected
Fixes: 2c8e31f5 ("pcm: hw - fix snd_pcm_hw_state()")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
c8f608d674
commit
c7a939ee31
1 changed files with 4 additions and 3 deletions
|
|
@ -600,9 +600,10 @@ 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)
|
static snd_pcm_state_t snd_pcm_hw_state(snd_pcm_t *pcm)
|
||||||
{
|
{
|
||||||
snd_pcm_hw_t *hw = pcm->private_data;
|
snd_pcm_hw_t *hw = pcm->private_data;
|
||||||
/* no error checking, the mmap state should be correct
|
/* the -ENODEV may come from the snd_disconnect_ioctl() in kernel */
|
||||||
* after SNDRV_PCM_IOCTL_SYNC_PTR */
|
/* in this case, the mmaped state is no longer updated */
|
||||||
query_status_data(hw);
|
if (query_status_data(hw) == -ENODEV)
|
||||||
|
return SND_PCM_STATE_DISCONNECTED;
|
||||||
return (snd_pcm_state_t) hw->mmap_status->state;
|
return (snd_pcm_state_t) hw->mmap_status->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue