From 573b10bc83defa2c9cdfb8f786c195b4d39e4078 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 23 Apr 2013 10:27:35 +0200 Subject: [PATCH] media: release lock when removing fakesink --- gst/rtsp-server/rtsp-media.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index e48f70cdf1..7609bff04f 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -1444,11 +1444,12 @@ remove_fakesink (GstRTSPMediaPrivate * priv) GstElement *fakesink; g_mutex_lock (&priv->lock); - if ((fakesink = priv->fakesink)) { + if ((fakesink = priv->fakesink)) gst_object_ref (fakesink); - priv->fakesink = NULL; - g_mutex_unlock (&priv->lock); + priv->fakesink = NULL; + g_mutex_unlock (&priv->lock); + if (fakesink) { gst_bin_remove (GST_BIN (priv->pipeline), fakesink); gst_element_set_state (fakesink, GST_STATE_NULL); gst_object_unref (fakesink);