From 733ef1162b78809751ccb327cbd0b07f46e6a42e Mon Sep 17 00:00:00 2001 From: Branko Subasic Date: Fri, 19 Sep 2014 18:28:30 +0200 Subject: [PATCH] rtsp-client: Allow backlog to grow while expiring session Allow the send backlog in the RTSP watch to grow to unlimited size while attempting to bring the media pipeline to NULL due to a session expiring. Without this change the appsink element cannot change state because it is blocked while rendering data in the new_sample callback. This callback will block until it has successfully put the data into the send backlog. There is a chance that the send backlog is full at this point which means that the callback may block for a long time, possibly forever. Therefore the media pipeline may also be prevented from changing state for a long time. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736647 --- gst/rtsp-server/rtsp-client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 0e8b03dbac..3d4ce91134 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -2211,7 +2211,11 @@ client_session_removed (GstRTSPSessionPool * pool, GstRTSPSession * session, GST_INFO ("client %p: session %p removed", client, session); g_mutex_lock (&priv->lock); + if (priv->watch != NULL) + gst_rtsp_watch_set_send_backlog (priv->watch, 0, 0); client_unwatch_session (client, session, NULL); + if (priv->watch != NULL) + gst_rtsp_watch_set_send_backlog (priv->watch, 0, WATCH_BACKLOG_SIZE); g_mutex_unlock (&priv->lock); }