]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
pulse - Fix capture problem
authorTakashi Iwai <tiwai@suse.de>
Wed, 15 Oct 2008 10:18:23 +0000 (12:18 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 15 Oct 2008 10:18:23 +0000 (12:18 +0200)
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 <tiwai@suse.de>
pulse/pcm_pulse.c

index a5f794f6bb49ca961ac04d115fc1338b375fa209..3d15ff0d8af122764fe5bb5398eeddb26a7f4bda 100644 (file)
@@ -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;