From 47458ae7de308cb347ba634a445b3cec8589a20c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 15 Oct 2008 12:18:23 +0200 Subject: pulse - Fix capture problem In pulse_start(), pa_stream_trigger() may return NULL for the capture stream, and this caused -EIO error. Allow now pa_stream_trigger() returning NULL. Signed-off-by: Takashi Iwai --- pulse/pcm_pulse.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c index a5f794f..3d15ff0 100644 --- a/pulse/pcm_pulse.c +++ b/pulse/pcm_pulse.c @@ -145,18 +145,15 @@ static int pulse_start(snd_pcm_ioplug_t * io) u = pa_stream_trigger(pcm->stream, pulse_stream_success_cb, pcm->p); - if (!u) { - pa_operation_unref(o); - err = -EIO; - goto finish; - } pcm->underrun = 0; err_o = pulse_wait_operation(pcm->p, o); - err_u = pulse_wait_operation(pcm->p, u); + if (u) + err_u = pulse_wait_operation(pcm->p, u); pa_operation_unref(o); - pa_operation_unref(u); + if (u) + pa_operation_unref(u); if (err_o < 0 || err_u < 0) { err = -EIO; -- cgit