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>
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);