rtsp-stream: Don't bind the sockets to multicast addresses
authorSebastian Dröge <sebastian@centricular.com>
Wed, 2 Mar 2016 09:47:47 +0000 (11:47 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 2 Mar 2016 09:47:47 +0000 (11:47 +0200)
This works on Linux but fails completely on Windows. You're supposed
to bind to ANY and then join the multicast group.

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

gst/rtsp-server/rtsp-stream.c

index cf2c88f6c5b4ab7cf4293afcf22d2f18b72e92bb..8cbedc36e0e606f00d9e040ac13f1f3de4003c11 100644 (file)
@@ -1261,6 +1261,15 @@ again:
 
     g_clear_object (&inetaddr);
     inetaddr = g_inet_address_new_from_string (addr->address);
+
+    /* Don't bind to multicast addresses, this does not work on
+     * Windows. You're supposed to bind to ANY and then join the
+     * multicast group, which udpsrc/sink does for us already.
+     */
+    if (g_inet_address_get_is_multicast (inetaddr)) {
+      g_object_unref (inetaddr);
+      inetaddr = g_inet_address_new_any (family);
+    }
   } else {
     if (tmp_rtp != 0) {
       tmp_rtp += 2;