Re: [PATCH] fix snd_pcm_drain() excluding SETUP state from valid states

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dne 02. 05. 20 v 21:33 sylvain.bertrand@xxxxxxxxx napsal(a):
once draining is done, the pcm enters the SETUP state, which ought to
be valid for snd_pcm_drain()

signed-off-by: Sylvain BERTRAND <sylvain.bertrand@xxxxxxxxxx>
---

I missed this one in my previous patch because exiting with or without
an error once draining is done was producing the same result.

NAK: You should not call drain when the PCM handle is in the SETUP field. It's an obvious caller problem. The streaming should be active somehow.

						Jaroslav


--- 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 */



--
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux