From: sylvain.bertrand@gmail.com Date: Sat, 2 May 2020 19:33:11 +0000 (+0000) Subject: pcm: fix snd_pcm_drain() excluding SETUP state from valid states X-Git-Tag: v1.2.3~23 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=1b9104b5ff10be7f60441f622436d4f14a2a97d1;p=alsa-lib.git pcm: fix snd_pcm_drain() excluding SETUP state from valid states once draining is done, the pcm enters the SETUP state, which ought to be valid for snd_pcm_drain() signed-off-by: Sylvain BERTRAND Signed-off-by: Jaroslav Kysela --- diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index 1064044c..b8ac4393 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -1329,7 +1329,7 @@ int snd_pcm_drain(snd_pcm_t *pcm) SNDMSG("PCM not set up"); return -EIO; } - err = bad_pcm_state(pcm, P_STATE_RUNNABLE); + err = bad_pcm_state(pcm, P_STATE_RUNNABLE | P_STATE(SETUP)); if (err < 0) return err; /* lock handled in the callback */