From 7ed250c7932047361a57e6e6ca96dc89aed60f7e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 10 Nov 2010 11:04:48 +0100 Subject: [PATCH] rtspsrc: select multicast transports in a smarter way When we see a multicast address in the SDP connection, only try to negotiate a multicast transport with the server. Fixes #634093 --- gst/rtsp/gstrtspsrc.c | 11 ++++++++++- gst/rtsp/gstrtspsrc.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index ba2c29a9c8..a5fd4e6567 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -915,9 +915,14 @@ gst_rtspsrc_do_stream_connection (GstRTSPSrc * src, GstRTSPStream * stream, else return; - /* save address, FIXME, check for multicast */ + /* save address */ g_free (stream->destination); stream->destination = g_strdup (conn->address); + + /* check for multicast */ + stream->is_multicast = + gst_sdp_address_is_multicast (conn->nettype, conn->addrtype, + conn->address); stream->ttl = conn->ttl; } @@ -4849,6 +4854,10 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src) GST_DEBUG_OBJECT (src, "doing setup of stream %p with %s", stream, stream->conninfo.location); + /* if we have a multicast connection, only suggest multicast from now on */ + if (stream->is_multicast) + protocols &= GST_RTSP_LOWER_TRANS_UDP_MCAST; + next_protocol: /* first selectable protocol */ while (protocol_masks[mask] && !(protocols & protocol_masks[mask])) diff --git a/gst/rtsp/gstrtspsrc.h b/gst/rtsp/gstrtspsrc.h index a15ec88412..b1402c2aaa 100644 --- a/gst/rtsp/gstrtspsrc.h +++ b/gst/rtsp/gstrtspsrc.h @@ -145,6 +145,7 @@ struct _GstRTSPStream { /* destination */ gchar *destination; + gboolean is_multicast; guint ttl; };