From b126dee96413730a41362952218ed4796b91f31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 7 Sep 2009 10:49:51 +0000 Subject: [PATCH] =?UTF-8?q?Use=20all=2032=20bits=20of=20the=20timestamp=20?= =?UTF-8?q?when=20calculating=20flv=20duration.=20At=20the=20moment,=20dur?= =?UTF-8?q?ation=20is=20mainly=20set=20from=20the=20metadata=20packet.=20I?= =?UTF-8?q?f=20that=20is=20not=20available,=20the=20fallback=20is=20checki?= =?UTF-8?q?ng=20the=20low=2024=20bits=20of=20the=20last=20packet.=20This?= =?UTF-8?q?=20is=20not=20enough=20for=20files=20over=204,6=20hours=20in=20?= =?UTF-8?q?length,=20so=20read=20all=2032=20bits=20instead.=20patch=20by?= =?UTF-8?q?=20Martin=20Storsj=C3=B6,=20martin=20martin=20st?= 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(-) 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); }