From 6c0c90c9d22a3c969e364d559f0a4174931bd08f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Tue, 30 Sep 2014 16:36:51 -0700 Subject: [PATCH] client: set session media to NULL without the lock We need to set session medias to NULL without the client lock otherwise we can end up in a deadlock if another thread is waiting for the lock and media unprepare is also waiting for that thread to end. https://bugzilla.gnome.org/show_bug.cgi?id=737690 --- gst/rtsp-server/rtsp-client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index aa0ab98..b00993a 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -346,9 +346,6 @@ client_unwatch_session (GstRTSPClient * client, GstRTSPSession * session, priv->session_removed_id = 0; } - /* unlink all media managed in this session */ - gst_rtsp_session_filter (session, filter_session_media, client); - /* remove the session */ g_object_unref (session); } @@ -357,6 +354,10 @@ static GstRTSPFilterResult cleanup_session (GstRTSPClient * client, GstRTSPSession * sess, gpointer user_data) { + /* unlink all media managed in this session. This needs to happen + * without the client lock, so we really want to do it here. */ + gst_rtsp_session_filter (sess, filter_session_media, client); + return GST_RTSP_FILTER_REMOVE; } -- 2.7.4