]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
pulse - Fix useless assert
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Mar 2008 12:00:44 +0000 (13:00 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 6 Jun 2008 13:53:52 +0000 (15:53 +0200)
If stream connection failes, don't assume that stream is connected upon closing.

ALSA bug#3831:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3831

Signed-off-by: Takashi Iwai <tiwai@suse.de>
pulse/pcm_pulse.c

index b6d5b463622fb258c088750aa232cb1f67797257..15e3f50b78ba8b51610914072e94278b0388bbee 100644 (file)
@@ -112,12 +112,14 @@ static int pulse_stop(snd_pcm_ioplug_t *io)
 
     pa_threaded_mainloop_lock(pcm->p->mainloop);
 
-    assert(pcm->stream);
-
     err = pulse_check_connection(pcm->p);
     if (err < 0)
         goto finish;
 
+    /* If stream connection fails, this gets called anyway */
+    if (pcm->stream == NULL)
+        goto finish;
+
     o = pa_stream_flush(pcm->stream, pulse_stream_success_cb, pcm->p);
     assert(o);