From dbf91ab231ad793646c6de540f105b4b24db9f25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6ran=20J=C3=B6nsson?= Date: Mon, 26 Sep 2016 11:16:04 +0200 Subject: [PATCH] rtsp-client: Session filter in unwatch session Call session filter with filter_session_media as paramer in client_unwatch_session if using drop_backlog = FALSE. In client_unwatch_session its allowed to grow the watchs backlog. If using drop_backlog = FALSE and the backlog is full it will cause a deadlock when setting session media state to NULL if the backlog is not allowed to grow. https://bugzilla.gnome.org/show_bug.cgi?id=771983 --- gst/rtsp-server/rtsp-client.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index e1e5338..deb2ab3 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -416,6 +416,11 @@ client_unwatch_session (GstRTSPClient * client, GstRTSPSession * session, priv->session_removed_id = 0; } + if (!priv->drop_backlog) { + /* unlink all media managed in this session */ + gst_rtsp_session_filter (session, filter_session_media, client); + } + /* remove the session */ g_object_unref (session); } @@ -425,10 +430,13 @@ cleanup_session (GstRTSPClient * client, GstRTSPSession * sess, gpointer user_data) { gboolean *closed = user_data; + GstRTSPClientPrivate *priv = client->priv; - /* 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, user_data); + if (priv->drop_backlog) { + /* 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, user_data); + } if (*closed) return GST_RTSP_FILTER_REMOVE; -- 2.7.4