summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2010-11-10 11:04:48 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2010-12-02 19:16:47 +0100
commit7ed250c7932047361a57e6e6ca96dc89aed60f7e (patch)
treecdefe90a01ea28f89bbaa720c5a0157389c6b0ab
parentcad6e95c04a7a2400c4295415e51ee8e5ba35f7f (diff)
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
-rw-r--r--gst/rtsp/gstrtspsrc.c11
-rw-r--r--gst/rtsp/gstrtspsrc.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index ba2c29a9c..a5fd4e656 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 a15ec8841..b1402c2aa 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;
};