pulsesink: avoid segfault when shutting down

when we are shutting down, we might still receive state updates from pulseaudio
but since we are unparented we should not do anything with the NULL parent
anymore.
This commit is contained in:
Wim Taymans 2010-01-27 13:26:46 +01:00
parent caec8d9837
commit 55b5e2e3f3

View file

@ -306,6 +306,11 @@ gst_pulsering_context_state_cb (pa_context * c, void *userdata)
state = pa_context_get_state (c);
GST_LOG_OBJECT (psink, "got new context state %d", state);
/* psink can be null when we are shutting down and the ringbuffer is already
* unparented */
if (psink == NULL)
return;
switch (state) {
case PA_CONTEXT_READY:
case PA_CONTEXT_TERMINATED: