Commit 589b8282 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/udp/gstmultiudpsink.c: Fix multicast detection.

Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_add):
Fix multicast detection.
Don't try to join a multicast group if the address is not multicast.
* gst/udp/gstudpsrc.c: (gst_udpsrc_update_uri):
Small debug improvement.
parent 6a790cb7
2007-04-29 Wim Taymans <wim@fluendo.com>
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_add):
Fix multicast detection.
Don't try to join a multicast group if the address is not multicast.
* gst/udp/gstudpsrc.c: (gst_udpsrc_update_uri):
Small debug improvement.
2007-04-27 Wim Taymans <wim@fluendo.com>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_stream_configure_transport),
......
......@@ -478,18 +478,19 @@ gst_multiudpsink_add (GstMultiUDPSink * sink, const gchar * host, gint port)
/* if its an IP address */
if (inet_aton (host, &addr)) {
/* check if its a multicast address */
if ((ntohl (addr.s_addr) & 0xe0000000) == 0xe0000000) {
GST_DEBUG_OBJECT (sink, "multicast address detected");
if ((ntohl (addr.s_addr) & 0xf0000000) == 0xe0000000) {
GST_DEBUG_OBJECT (sink, "multicast address detected");
client->multi_addr.imr_multiaddr.s_addr = addr.s_addr;
client->multi_addr.imr_interface.s_addr = INADDR_ANY;
client->theiraddr.sin_addr = client->multi_addr.imr_multiaddr;
} else {
GST_DEBUG_OBJECT (sink, "normal address detected");
client->theiraddr.sin_addr = *((struct in_addr *) &addr);
}
/* if init_send has already been called, set sockopts for multicast */
if (*client->sock > 0)
if (*client->sock > 0 && client->multi_addr.imr_multiaddr.s_addr)
join_multicast (client);
}
/* we dont need to lookup for localhost */
......
......@@ -550,6 +550,8 @@ gst_udpsrc_update_uri (GstUDPSrc * src)
{
g_free (src->uri);
src->uri = g_strdup_printf ("udp://%s:%d", src->multi_group, src->port);
GST_DEBUG_OBJECT (src, "updated uri to %s", src->uri);
}
static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment