#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,
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);
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));
}
}