[vlc-devel] commit: Copy IPv4 multicast TTL from RTP to RTCP. ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Feb 23 17:33:54 CET 2009


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Mon Feb 23 18:24:58 2009 +0200| [19c943dc3b2883d09f490e25c36e19ff8d814d37] | committer: Rémi Denis-Courmont 

Copy IPv4 multicast TTL from RTP to RTCP.

We were sending RTCP with TTL=1 all the time...
(cherry picked from commit 7da51390659d29b3022c748b6e8491ad3e37f5e6)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=19c943dc3b2883d09f490e25c36e19ff8d814d37
---

 modules/stream_out/rtcp.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/stream_out/rtcp.c b/modules/stream_out/rtcp.c
index cbc3dad..3c1780e 100644
--- a/modules/stream_out/rtcp.c
+++ b/modules/stream_out/rtcp.c
@@ -99,6 +99,16 @@ 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)
+        {
+            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);
+        }
     }
 
     if (fd == -1)




More information about the vlc-devel mailing list