From f1f1aa2a8698ab414e8399104da0684d33836c36 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 10 Mar 2008 13:00:44 +0100 Subject: pulse - Fix useless assert 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 --- pulse/pcm_pulse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pulse/pcm_pulse.c') diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c index b6d5b46..15e3f50 100644 --- a/pulse/pcm_pulse.c +++ b/pulse/pcm_pulse.c @@ -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); -- cgit