X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fstream_out%2Frtcp.c;h=83420b9e17051b24264be28c9766c7072d737a90;hb=f659703fb4033420e0607d34bc7cd880a5802ea7;hp=cbc3dade8a96374c56197623868f763a28f7ae0b;hpb=a58caab63564d9940258e7daa9ba88e48a903cec;p=vlc diff --git a/modules/stream_out/rtcp.c b/modules/stream_out/rtcp.c index cbc3dade8a..83420b9e17 100644 --- a/modules/stream_out/rtcp.c +++ b/modules/stream_out/rtcp.c @@ -32,10 +32,15 @@ #include #include +#include #include "rtp.h" #include +#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, @@ -78,7 +83,10 @@ 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; #else WSAPROTOCOL_INFO info; WSADuplicateSocket (rtp_fd, GetCurrentProcessId (), &info); @@ -99,6 +107,18 @@ 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); + 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)