mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-09 13:30:03 -05:00
pcm: improve handling for snd_pcm_wait()
The snd_pcm_wait() function is called also internally from the various plugins to wait for the drain with -1 and from i/o routines in pcm.c. Define two special negative timeout values to distinguish the drain and i/o wait and calculate the maximal timeout according the wait place. Fixes: https://github.com/alsa-project/alsa-lib/issues/228 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
1de6f99c7d
commit
e2d9e41174
9 changed files with 55 additions and 10 deletions
|
|
@ -1194,7 +1194,7 @@ static int snd_pcm_share_drain(snd_pcm_t *pcm)
|
|||
_snd_pcm_share_update(pcm);
|
||||
Pthread_mutex_unlock(&slave->mutex);
|
||||
if (!(pcm->mode & SND_PCM_NONBLOCK))
|
||||
snd_pcm_wait(pcm, -1);
|
||||
snd_pcm_wait(pcm, SND_PCM_WAIT_DRAIN);
|
||||
return 0;
|
||||
default:
|
||||
assert(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue