diff options
author | Jaroslav Kysela <perex@perex.cz> | 2023-05-02 16:56:49 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2023-05-03 15:59:15 +0200 |
commit | e2d9e411744dede5a71e04a107cdc0ab7c1d0ed9 (patch) | |
tree | 412e10ce1479c1a860ace74209dd91bd86dbdf30 /src/pcm/pcm_dshare.c | |
parent | 1de6f99c7d058634b5550fa59c01f3b6546f830a (diff) | |
download | alsa-lib-e2d9e411744dede5a71e04a107cdc0ab7c1d0ed9.tar.gz |
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>
Diffstat (limited to 'src/pcm/pcm_dshare.c')
-rw-r--r-- | src/pcm/pcm_dshare.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c index d7be8fbb..454b39a9 100644 --- a/src/pcm/pcm_dshare.c +++ b/src/pcm/pcm_dshare.c @@ -400,7 +400,7 @@ static int __snd_pcm_dshare_drain(snd_pcm_t *pcm) } if (dshare->state == SND_PCM_STATE_DRAINING) { snd_pcm_dshare_sync_area(pcm); - snd_pcm_wait_nocheck(pcm, -1); + snd_pcm_wait_nocheck(pcm, SND_PCM_WAIT_DRAIN); snd_pcm_direct_clear_timer_queue(dshare); /* force poll to wait */ switch (snd_pcm_state(dshare->spcm)) { |