From 03f2e81f69b55aa8a34d343a9e419d1210842d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 19 Aug 2010 12:46:50 +0200 Subject: [PATCH] pulsesink: Free the clock on state change failures too --- ext/pulse/pulsesink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c index 4c3c559a0e..bb77ee4721 100644 --- a/ext/pulse/pulsesink.c +++ b/ext/pulse/pulsesink.c @@ -2616,6 +2616,10 @@ gst_pulsesink_change_state (GstElement * element, GstStateChange transition) /* Clear the PA mainloop if baseaudiosink failed to open the ring_buffer */ if (ret == GST_STATE_CHANGE_FAILURE && transition == GST_STATE_CHANGE_NULL_TO_READY) { + if (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock) + gst_object_unref (GST_BASE_AUDIO_SINK (pulsesink)->provided_clock); + GST_BASE_AUDIO_SINK (pulsesink)->provided_clock = NULL; + g_assert (pulsesink->mainloop); pa_threaded_mainloop_stop (pulsesink->mainloop); pa_threaded_mainloop_free (pulsesink->mainloop);