Commit 3defcef5 authored by Max Kellermann's avatar Max Kellermann

pulse: check if connection is open in pulse_cancel()

The pulse plugin crashed with a segmentation fault when the pulse server was killed.
parent eedbd28e
...@@ -162,6 +162,9 @@ static void pulse_cancel(void *data) ...@@ -162,6 +162,9 @@ static void pulse_cancel(void *data)
struct pulse_data *pd = data; struct pulse_data *pd = data;
int error; int error;
if (pd->s == NULL)
return;
if (pa_simple_flush(pd->s, &error) < 0) if (pa_simple_flush(pd->s, &error) < 0)
g_warning("Flush failed in PulseAudio output \"%s\": %s\n", g_warning("Flush failed in PulseAudio output \"%s\": %s\n",
audio_output_get_name(pd->ao), audio_output_get_name(pd->ao),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment