mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm: dmix: Fix the inconsistent PCM state
The commit38a2d2eda8("pcm: dmix: Do not discard slave reported delay in...") changed the handling in snd_pcm_dmix_status() for taking the actual delay from the slave PCM status. Along with it, the commit removed the line to update its own state altogether, as it had been done originally in the dshare patch (commitfaf53c197c"pcm_dshare: Do not discard slave reported delay..."), supposing that the slave PCM keeps this same state. However, for dmix/dshare, the PCM state may differ from the slave, thus these changes resulted in the inconsistent PCM state. For dshare, the issue was already addressed by commitad6957c618("plugin:dshare: wrong state reporting"), while the fix for dmix was forgotten until now. This patch restores the code to set the proper dmix PCM state again like in the previous versions. Fixes:38a2d2eda8("pcm: dmix: Do not discard slave reported delay in...") Reported-by: Cheng Sun <chengsun9@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
bb862e3bb1
commit
3752e6b873
1 changed files with 1 additions and 0 deletions
|
|
@ -501,6 +501,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status->state = snd_pcm_dmix_state(pcm);
|
||||||
status->trigger_tstamp = dmix->trigger_tstamp;
|
status->trigger_tstamp = dmix->trigger_tstamp;
|
||||||
status->avail = snd_pcm_mmap_playback_avail(pcm);
|
status->avail = snd_pcm_mmap_playback_avail(pcm);
|
||||||
status->avail_max = status->avail > dmix->avail_max ? status->avail : dmix->avail_max;
|
status->avail_max = status->avail > dmix->avail_max ? status->avail : dmix->avail_max;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue