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
This commit is contained in:
Anila Balavan 2015-01-30 12:50:20 +01:00 committed by Sebastian Dröge
parent 6987a00fa9
commit 18668bf495

View file

@ -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);