From: Jaroslav Kysela Date: Mon, 20 Mar 2017 07:41:53 +0000 (+0100) Subject: dmix plugin: drain - quickfix for the previous patch X-Git-Tag: v1.1.4~21 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=e4377b16454f3b7b222613a571bf4244ebd28e56;p=alsa-lib.git dmix plugin: drain - quickfix for the previous patch --- diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c index de00ea88..c64ae5fc 100644 --- a/src/pcm/pcm_dmix.c +++ b/src/pcm/pcm_dmix.c @@ -674,16 +674,16 @@ static int __snd_pcm_dmix_drain(snd_pcm_t *pcm) case SND_PCM_STATE_SUSPENDED: err = -ESTRPIPE; goto done; - case SND_PCM_STATE_DRAINING: - if (pcm->mode & SND_PCM_NONBLOCK) { - err = -EAGAIN; - goto done; - } - break; default: break; } } + if (pcm->mode & SND_PCM_NONBLOCK) { + if (dmix->state == SND_PCM_STATE_DRAINING) { + err = -EAGAIN; + goto done; + } + } } while (dmix->state == SND_PCM_STATE_DRAINING); done: pcm->stop_threshold = stop_threshold;