From b126dee96413730a41362952218ed4796b91f31c Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 7 Sep 2009 10:49:51 +0000 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 19791 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/flvdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 82e4b68a64..c982708e0a 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -369,7 +369,9 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) 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); } -- cgit v1.2.3