[vlc-devel] commit: RTP sout: append RTCP BYE to the Sender Report ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Jun 16 18:45:56 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Mon Jun 16 19:47:40 2008 +0300| [297002cf2c9237445fbe2435d9c9ce3ac3b67ff0]

RTP sout: append RTCP BYE to the Sender Report

Pointed-out-by: Sébastien Escudier

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

 modules/stream_out/rtcp.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/stream_out/rtcp.c b/modules/stream_out/rtcp.c
index 438f3d9..5525b76 100644
--- a/modules/stream_out/rtcp.c
+++ b/modules/stream_out/rtcp.c
@@ -53,7 +53,7 @@
 struct rtcp_sender_t
 {
     size_t   length;  /* RTCP packet length */
-    uint8_t  payload[28 + 8 + (2 * 257)];
+    uint8_t  payload[28 + 8 + (2 * 257) + 8];
     int      handle;  /* RTCP socket handler */
 
     uint32_t packets; /* RTP packets sent */
@@ -164,15 +164,20 @@ void CloseRTCP (rtcp_sender_t *rtcp)
         return;
 
     uint8_t *ptr = rtcp->payload;
+    uint64_t now64 = NTPtime64 ();
+    SetQWBE (ptr + 8, now64); /* Update the Sender Report timestamp */
+
     /* Bye */
+    ptr += rtcp->length;
     ptr[0] = (2 << 6) | 1; /* V = 2, P = 0, SC = 1 */
     ptr[1] = 203; /* payload type: Bye */
     SetWBE (ptr + 2, 1);
-    /* SSRC is already there :) */
+    memcpy (ptr + 4, rtcp->payload + 4, 4); /* Copy SSRC from Sender Report */
+    rtcp->length += 8;
 
     /* We are THE sender, so we are more important than anybody else, so
      * we can afford not to check bandwidth constraints here. */
-    send (rtcp->handle, rtcp->payload, 8, 0);
+    send (rtcp->handle, rtcp->payload, rtcp->length, 0);
     net_Close (rtcp->handle);
 }
 




More information about the vlc-devel mailing list