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
This commit is contained in:
Wim Taymans 2010-11-10 11:04:48 +01:00
parent cad6e95c04
commit 7ed250c793
2 changed files with 11 additions and 1 deletions

View file

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

View file

@ -145,6 +145,7 @@ struct _GstRTSPStream {
/* destination */
gchar *destination;
gboolean is_multicast;
guint ttl;
};