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:
		@@ -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),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user