rtsp-stream: Disable multicast loopback for all our sockets
authorSebastian Dröge <sebastian@centricular.com>
Sat, 5 Mar 2016 08:52:11 +0000 (10:52 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 5 Mar 2016 08:53:15 +0000 (10:53 +0200)
On Windows this is a receiver-side setting, on Linux a sender-side setting. As
we provide a socket ourselves to udpsrc, udpsrc is never setting the multicast
loopback setting on the socket... while udpsink does which unfortunately has
no effect here on Windows but on Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=757488

gst/rtsp-server/rtsp-stream.c

index fb71469..550ef50 100644 (file)
@@ -1214,6 +1214,7 @@ alloc_ports_one_family (GstRTSPStream * stream, GSocketFamily family,
       G_SOCKET_PROTOCOL_UDP, NULL);
   if (!rtcp_socket)
     goto no_udp_protocol;
+  g_socket_set_multicast_loopback (rtcp_socket, FALSE);
 
   if (*server_addr_out)
     gst_rtsp_address_free (*server_addr_out);
@@ -1227,6 +1228,7 @@ again:
         G_SOCKET_PROTOCOL_UDP, NULL);
     if (!rtp_socket)
       goto no_udp_protocol;
+    g_socket_set_multicast_loopback (rtp_socket, FALSE);
   }
 
   if (pool && ((transport == GST_RTSP_LOWER_TRANS_UDP &&