From 18668bf49570b3ab75e35dd275f4761f0210cc42 Mon Sep 17 00:00:00 2001 From: Anila Balavan Date: Fri, 30 Jan 2015 12:50:20 +0100 Subject: [PATCH 1/1] rtsp-stream: RTCP and RTP transport cache cookies seperated RTCP packets were not sent because the same tr_cache_cookie was used for both RTP and RTCP. So only one of the tr_cache lists were populated depending on which one was sent first. If the tr_cache list is not populated then no packets can be sent. Most often this happened to be RTCP. Now seperate RTCP and RTP transport cache cookies are added which resulted in both the tr_cache_lists to be populated regardless of which one was sent first. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=743734 --- gst/rtsp-server/rtsp-stream.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c index 9a7a59f..d2e0432 100644 --- a/gst/rtsp-server/rtsp-stream.c +++ b/gst/rtsp-server/rtsp-stream.c @@ -141,7 +141,9 @@ struct _GstRTSPStreamPrivate guint transports_cookie; GList *tr_cache_rtp; GList *tr_cache_rtcp; - guint tr_cache_cookie; + guint tr_cache_cookie_rtp; + guint tr_cache_cookie_rtcp; + /* UDP sources for UDP multicast transports */ GList *transport_sources; @@ -1610,19 +1612,26 @@ handle_new_sample (GstAppSink * sink, gpointer user_data) is_rtp = GST_ELEMENT_CAST (sink) == priv->appsink[0]; g_mutex_lock (&priv->lock); - if (priv->tr_cache_cookie != priv->transports_cookie) { - clear_tr_cache (priv, is_rtp); - for (walk = priv->transports; walk; walk = g_list_next (walk)) { - GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data; - if (is_rtp) { + if (is_rtp) { + if (priv->tr_cache_cookie_rtp != priv->transports_cookie) { + clear_tr_cache (priv, is_rtp); + for (walk = priv->transports; walk; walk = g_list_next (walk)) { + GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data; priv->tr_cache_rtp = g_list_prepend (priv->tr_cache_rtp, g_object_ref (tr)); - } else { + } + priv->tr_cache_cookie_rtp = priv->transports_cookie; + } + } else { + if (priv->tr_cache_cookie_rtcp != priv->transports_cookie) { + clear_tr_cache (priv, is_rtp); + for (walk = priv->transports; walk; walk = g_list_next (walk)) { + GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data; priv->tr_cache_rtcp = g_list_prepend (priv->tr_cache_rtcp, g_object_ref (tr)); } + priv->tr_cache_cookie_rtcp = priv->transports_cookie; } - priv->tr_cache_cookie = priv->transports_cookie; } g_mutex_unlock (&priv->lock); -- 2.7.4