#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,
{
/* 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;
#else
WSAPROTOCOL_INFO info;
WSADuplicateSocket (rtp_fd, GetCurrentProcessId (), &info);
dport++;
fd = net_OpenDgram (obj, src, sport, dst, dport, AF_UNSPEC, 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));
+ }
}
if (fd == -1)