]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/rtcp.c
avcodec encoder: remove 10 years old non sense
[vlc] / modules / stream_out / rtcp.c
index 3c1780e4e5bb4419de05c2acf3548fe3aa20b2f5..46289db5a859a11295afd2c66807a9c9973298e0 100644 (file)
 
 #include <vlc_network.h>
 #include <vlc_sout.h>
+#include <vlc_fs.h>
 #include "rtp.h"
 
 #include <assert.h>
 
+#ifndef SOL_IP
+# define SOL_IP IPPROTO_IP
+#endif
+
 /*
  * NOTE on RTCP implementation:
  * - there is a single sender (us), no conferencing here! => n = sender = 1,
@@ -77,8 +82,8 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
     if (mux)
     {
         /* RTP/RTCP mux: duplicate the socket */
-#ifndef WIN32
-        fd = dup (rtp_fd);
+#ifndef _WIN32
+        fd = vlc_dup (rtp_fd);
 #else
         WSAPROTOCOL_INFO info;
         WSADuplicateSocket (rtp_fd, GetCurrentProcessId (), &info);
@@ -98,16 +103,18 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
         sport++;
         dport++;
 
-        fd = net_OpenDgram (obj, src, sport, dst, dport, AF_UNSPEC, proto);
-
-        /* Copy the multicast IPv4 TTL value (useless for IPv6) */
+        fd = net_OpenDgram (obj, src, sport, dst, dport, proto);
         if (fd != -1)
         {
+            /* Copy the multicast IPv4 TTL value (useless for IPv6) */
             int ttl;
             socklen_t len = sizeof (ttl);
 
             if (!getsockopt (rtp_fd, SOL_IP, IP_MULTICAST_TTL, &ttl, &len))
                 setsockopt (fd, SOL_IP, IP_MULTICAST_TTL, &ttl, len);
+
+            /* Ignore all incoming RTCP-RR packets */
+            setsockopt (fd, SOL_SOCKET, SO_RCVBUF, &(int){ 0 }, sizeof (int));
         }
     }