pulse: check if connection is open in pulse_cancel()

The pulse plugin crashed with a segmentation fault when the pulse
server was killed.
This commit is contained in:
Max Kellermann 2008-11-05 08:06:39 +01:00
parent eedbd28ec9
commit 3defcef5f3

View File

@ -162,6 +162,9 @@ static void pulse_cancel(void *data)
struct pulse_data *pd = data;
int error;
if (pd->s == NULL)
return;
if (pa_simple_flush(pd->s, &error) < 0)
g_warning("Flush failed in PulseAudio output \"%s\": %s\n",
audio_output_get_name(pd->ao),