811cb8f
If stream connection failes, don't assume that stream is connected upon closing.
811cb8f
811cb8f
diff -urp alsa-plugins-1.0.16.orig/pulse/pcm_pulse.c alsa-plugins-1.0.16/pulse/pcm_pulse.c
811cb8f
--- alsa-plugins-1.0.16.orig/pulse/pcm_pulse.c	2008-02-05 10:25:00.000000000 +0100
811cb8f
+++ alsa-plugins-1.0.16/pulse/pcm_pulse.c	2008-03-08 14:33:43.000000000 +0100
811cb8f
@@ -112,12 +112,14 @@ static int pulse_stop(snd_pcm_ioplug_t *
811cb8f
 
811cb8f
     pa_threaded_mainloop_lock(pcm->p->mainloop);
811cb8f
 
811cb8f
-    assert(pcm->stream);
811cb8f
-
811cb8f
     err = pulse_check_connection(pcm->p);
811cb8f
     if (err < 0)
811cb8f
         goto finish;
811cb8f
 
811cb8f
+    /* If stream connection fails, this gets called anyway */
811cb8f
+    if (pcm->stream == NULL)
811cb8f
+        goto finish;
811cb8f
+
811cb8f
     o = pa_stream_flush(pcm->stream, pulse_stream_success_cb, pcm->p);
811cb8f
     assert(o);
811cb8f