]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/rtcp.c
Adjustments to better match VLC coding style.
[vlc] / modules / stream_out / rtcp.c
index 5680e9b3f0cc66ab7e4c6aeb4c0049ad09f46c22..83420b9e17051b24264be28c9766c7072d737a90 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <vlc_network.h>
 #include <vlc_sout.h>
+#include <vlc_fs.h>
 #include "rtp.h"
 
 #include <assert.h>
@@ -82,7 +83,7 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
     {
         /* RTP/RTCP mux: duplicate the socket */
 #ifndef WIN32
-        fd = dup (rtp_fd);
+        fd = vlc_dup (rtp_fd);
 #elif defined(UNDER_CE)
  #warning Muxed RTP/RTCP unimplemented!
         fd = -1;
@@ -106,15 +107,17 @@ rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
         dport++;
 
         fd = net_OpenDgram (obj, src, sport, dst, dport, AF_UNSPEC, proto);
-
-        /* Copy the multicast IPv4 TTL value (useless for IPv6) */
         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));
         }
     }