diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-03-04 13:51:12 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-03-04 13:51:12 +0200 |
commit | 97948225499b37ceff773d77e345a2a0b7cb4593 (patch) | |
tree | 0268330805980038e4cac93fa22012c0de6502a9 | |
parent | a7ced98346c6d49c4569d1b609a773a042c46796 (diff) |
rtsp-stream: Only bind multicast sockets to ANY on Windows
On Linux it is still needed to bind to the multicast address
to filter out random other packets, while on Windows binding
to multicast addresses just fails.
-rw-r--r-- | gst/rtsp-server/rtsp-stream.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c index 272fbc9..fb71469 100644 --- a/gst/rtsp-server/rtsp-stream.c +++ b/gst/rtsp-server/rtsp-stream.c @@ -1262,14 +1262,21 @@ 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. + /* On Windows it's not possible to bind to a multicast address + * but the OS will make sure to filter out all packets that + * arrive not for the multicast address the socket joined. + * + * On Linux and others it is necessary to bind to a multicast + * address to let the OS filter out all packets that are received + * on the same port but for different addresses than the multicast + * address */ +#ifdef G_OS_WIN32 if (g_inet_address_get_is_multicast (inetaddr)) { g_object_unref (inetaddr); inetaddr = g_inet_address_new_any (family); } +#endif } else { if (tmp_rtp != 0) { tmp_rtp += 2; |