mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
pcm: multi plugin - fix wait_for_avail_min
All slaves should be asked to wait otherwise the write loop might be interrupted and zero frames might be returned. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
0d92f2d39a
commit
4694a6643d
1 changed files with 7 additions and 3 deletions
|
|
@ -775,11 +775,15 @@ static int snd_pcm_multi_mmap(snd_pcm_t *pcm)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int snd_pcm_multi_may_wait_for_avail_min(snd_pcm_t *pcm, snd_pcm_uframes_t avail ATTRIBUTE_UNUSED)
|
||||
static int snd_pcm_multi_may_wait_for_avail_min(snd_pcm_t *pcm, snd_pcm_uframes_t avail)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
snd_pcm_t *slave = multi->slaves[multi->master_slave].pcm;
|
||||
return snd_pcm_may_wait_for_avail_min(slave, snd_pcm_mmap_avail(slave));
|
||||
unsigned int i;
|
||||
for (i = 0; i < multi->slaves_count; ++i) {
|
||||
if (snd_pcm_may_wait_for_avail_min(multi->slaves[i].pcm, avail))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static snd_pcm_chmap_query_t **snd_pcm_multi_query_chmaps(snd_pcm_t *pcm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue