From 589b8282e8dc812883f5183aa2125da77b00dfb4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 29 Apr 2007 12:19:21 +0000 Subject: 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. --- gst/udp/gstmultiudpsink.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gst/udp/gstmultiudpsink.c') diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c index 542eb470..72fec4cf 100644 --- a/gst/udp/gstmultiudpsink.c +++ b/gst/udp/gstmultiudpsink.c @@ -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 */ -- cgit