[FFmpeg-devel] [PATCH 1/3] flvdec: Check index for being valid Fixes seeking in Enigma_Principles_of_Lust.flv

Michael Niedermayer michaelni at gmx.at
Fri Dec 30 04:05:12 CET 2011


On Thu, Dec 29, 2011 at 08:01:32PM -0500, Derek Buitenhuis wrote:
> On 29/12/2011 7:38 PM, Michael Niedermayer wrote:
> >-    if (timeslen == fileposlen && fileposlen && max_pos <= filepositions[0]) {
> >+    if (timeslen == fileposlen && fileposlen>1 && max_pos <= filepositions[0]) {
> 
> I'm not sure where the >1 comes in? Wouldn't this change behavior
> on previously working files?

yes and no, it would only affect files with just one keyframe. And
the "runtime" indexing would add that in an instant without this code.
it could be done a bit differently but then indexes with just one
keyframe would not be checked


> 
> >+        size0 = avio_rb32(ioc);
> >+                avio_r8(ioc);
> 
> Does this stray avio_r8() act like a skip? Sorry for having to ask.

yes


> 
> >+        if (size0 > filepositions[1] || FFABS(dts - times[1]*1000)>5000)
> 
> Where does this magic number (5000) come from? Again, sorry if I missed
> this.

just a random value (5 seconds) to avoid discarding an index due to
the timestamps being a bit off.
one surely can discuss the value for hours id say though 5sec is as
good as any until theres a testcase that needs something else.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111230/5afbf120/attachment.asc>


More information about the ffmpeg-devel mailing list