From bbdf0a47d18338459fa66ffa9aa8ab54ed527580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 5 May 2015 16:46:19 +0200 Subject: [PATCH] rtsp-media: Only unblock the media in suspend() when actually changing the state Otherwise we're going to lose a few packets for live streams during DESCRIBE. --- gst/rtsp-server/rtsp-media.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 344ac278de..7aabcf9bdf 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -3662,6 +3662,7 @@ default_suspend (GstRTSPMedia * media) { GstRTSPMediaPrivate *priv = media->priv; GstStateChangeReturn ret; + gboolean unblock = FALSE; switch (priv->suspend_mode) { case GST_RTSP_SUSPEND_MODE_NONE: @@ -3672,6 +3673,7 @@ default_suspend (GstRTSPMedia * media) ret = set_target_state (media, GST_STATE_PAUSED, TRUE); if (ret == GST_STATE_CHANGE_FAILURE) goto state_failed; + unblock = TRUE; break; case GST_RTSP_SUSPEND_MODE_RESET: GST_DEBUG ("media %p suspend to NULL", media); @@ -3684,13 +3686,15 @@ default_suspend (GstRTSPMedia * media) * is actually from NULL to PLAY will create a new sequence * number. */ g_ptr_array_foreach (priv->streams, (GFunc) do_set_seqnum, NULL); + unblock = TRUE; break; default: break; } /* let the streams do the state changes freely, if any */ - media_streams_set_blocked (media, FALSE); + if (unblock) + media_streams_set_blocked (media, FALSE); return TRUE;