rtsp-client: Allow backlog to grow while expiring session
authorBranko Subasic <branko@axis.com>
Fri, 19 Sep 2014 16:28:30 +0000 (18:28 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 24 Sep 2014 07:37:49 +0000 (10:37 +0300)
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

index 0e8b03d..3d4ce91 100644 (file)
@@ -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);
 }