[rtmpdump] [PATCH] Correctly handle timestamp rollover

Vladimir Yakovlev nagos at inbox.ru
Fri May 31 10:09:16 EEST 2019


Handle timestamp rollover after 4.5 hours
---
 librtmp/rtmp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c
index 0865689..efb15ee 100644
--- a/librtmp/rtmp.c
+++ b/librtmp/rtmp.c
@@ -3945,6 +3945,8 @@ RTMP_SendPacket(RTMP *r, RTMPPacket *packet, int queue)
   nSize = packetSize[packet->m_headerType];
   hSize = nSize; cSize = 0;
   t = packet->m_nTimeStamp - last;
+  if(t >= 0xffffffff/2)
+    t = 0xffffffff - t;
 
   if (packet->m_body)
     {
-- 
2.7.4



More information about the rtmpdump mailing list