From 6d3071f20070dd5ca5338908d3fa0b4c41be0e86 Mon Sep 17 00:00:00 2001 From: Brad Lackey Date: Fri, 1 Jul 2016 10:05:00 +0000 Subject: [PATCH] rtspsrc: Don't disable UDP protocols on redirecting https://bugzilla.gnome.org/show_bug.cgi?id=768232 --- gst/rtsp/gstrtspsrc.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 662e0f1..f63ba9d 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4878,26 +4878,30 @@ gst_rtspsrc_reconnect (GstRTSPSrc * src, gboolean async) if (!restart) goto done; - /* we can try only TCP now */ - src->cur_protocols = GST_RTSP_LOWER_TRANS_TCP; + /* unless redirect, try tcp */ + if (!src->need_redirect) + src->cur_protocols = GST_RTSP_LOWER_TRANS_TCP; /* close and cleanup our state */ if ((res = gst_rtspsrc_close (src, async, FALSE)) < 0) goto done; - /* see if we have TCP left to try. Also don't try TCP when we were configured - * with an SDP. */ - if (!(src->protocols & GST_RTSP_LOWER_TRANS_TCP) || src->from_sdp) + /* unless redirect, see if we have TCP left to try. Also don't + * try TCP when we were configured with an SDP. */ + if (!src->need_redirect && (!(src->protocols & GST_RTSP_LOWER_TRANS_TCP) + || src->from_sdp)) goto no_protocols; - /* We post a warning message now to inform the user - * that nothing happened. It's most likely a firewall thing. */ - GST_ELEMENT_WARNING (src, RESOURCE, READ, (NULL), - ("Could not receive any UDP packets for %.4f seconds, maybe your " - "firewall is blocking it. Retrying using a TCP connection.", - gst_guint64_to_gdouble (src->udp_timeout / 1000000.0))); + if (!src->need_redirect) { + /* We post a warning message now to inform the user + * that nothing happened. It's most likely a firewall thing. */ + GST_ELEMENT_WARNING (src, RESOURCE, READ, (NULL), + ("Could not receive any UDP packets for %.4f seconds, maybe your " + "firewall is blocking it. Retrying using a tcp connection.", + gst_guint64_to_gdouble (src->udp_timeout / 1000000.0))); + } - /* open new connection using tcp */ + /* unless redirect, open new connection using tcp */ if (gst_rtspsrc_open (src, async) < 0) goto open_failed; -- 2.7.4