From fb8004a6ebfbad1bc16c17d9bf0a845d2f760ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 15 Jun 2020 19:45:38 +0300 Subject: [PATCH] rtsp-media: Add/configure transports when completing the pipeline Otherwise the transports are not set up yet during the PLAY request handling when unsuspending (and thus unblocking) the media. In case of live pipelines this then causes the first few packets to go to the sinks before they know what to do with them, and they simply discard them which is rather suboptimal in case of keyframes. For non-live pipelines this is not a problem because the sink will still be PAUSED and as such not send out the data yet but wait until it goes to PLAYING, which is late enough. Adding the transports multiple times is not a problem: if the transport is already added it won't be added another time and TRUE will be returned. This fixes a regression introduced by a7732a68e8bc6b4ba15629c652056c240c624ff0 before 1.14.0. Fixes https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/issues/107 Part-of: --- gst/rtsp-server/rtsp-media.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index dad251fc3d..e42cbb29a8 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -5012,6 +5012,11 @@ gst_rtsp_media_complete_pipeline (GstRTSPMedia * media, GPtrArray * transports) g_mutex_unlock (&priv->lock); return FALSE; } + + if (!gst_rtsp_stream_add_transport (stream, transport)) { + g_mutex_unlock (&priv->lock); + return FALSE; + } } priv->complete = TRUE;