diff rtmppkt.c @ 5402:99aeb2e385df libavformat

Full-header RTMP packets contain real timestamp, others contain timestamp difference, so make all read packets store absolute timestamp. As a consequence, we don't need to track audio/video timestamps separately any longer in protocol handler.
author kostya
date Tue, 01 Dec 2009 16:08:44 +0000
parents 432e1b6e1568
children 6f2d4070ab5b
line wrap: on
line diff
--- a/rtmppkt.c	Tue Dec 01 15:13:23 2009 +0000
+++ b/rtmppkt.c	Tue Dec 01 16:08:44 2009 +0000
@@ -116,6 +116,8 @@
                 return AVERROR(EIO);
             timestamp = AV_RB32(buf);
         }
+        if (hdr != RTMP_PS_TWELVEBYTES)
+            timestamp += prev_pkt[channel_id].timestamp;
     }
     if (ff_rtmp_packet_create(p, channel_id, type, timestamp, data_size))
         return -1;