[FFmpeg-cvslog] r19791 - trunk/libavformat/flvdec.c

diego subversion
Mon Sep 7 12:49:51 CEST 2009


Author: diego
Date: Mon Sep  7 12:49:51 2009
New Revision: 19791

Log:
Use all 32 bits of the timestamp when calculating flv duration.
At the moment, duration is mainly set from the metadata packet. If that is not
available, the fallback is checking the low 24 bits of the last packet. This is
not enough for files over 4,6 hours in length, so read all 32 bits instead.
patch by Martin Storsj?, martin martin st

Modified:
   trunk/libavformat/flvdec.c

Modified: trunk/libavformat/flvdec.c
==============================================================================
--- trunk/libavformat/flvdec.c	Sun Sep  6 20:24:25 2009	(r19790)
+++ trunk/libavformat/flvdec.c	Mon Sep  7 12:49:51 2009	(r19791)
@@ -369,7 +369,9 @@ static int flv_read_packet(AVFormatConte
         size= get_be32(s->pb);
         url_fseek(s->pb, fsize-3-size, SEEK_SET);
         if(size == get_be24(s->pb) + 11){
-            s->duration= get_be24(s->pb) * (int64_t)AV_TIME_BASE / 1000;
+            uint32_t ts = get_be24(s->pb);
+            ts |= get_byte(s->pb) << 24;
+            s->duration = ts * (int64_t)AV_TIME_BASE / 1000;
         }
         url_fseek(s->pb, pos, SEEK_SET);
     }



More information about the ffmpeg-cvslog mailing list