[MPlayer-dev-eng] [PATCH] make AVI -forceidx search inside chunks > 1 MB

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Oct 27 09:40:06 CEST 2007


Hello,
attached patch would change avi demuxer behaviour to not skip any AVI
chunks > 1 MB but instead search inside those for stream data as well.
This admittedly is somewhat hackish (esp. due to the fixed 1 MB limit),
but it helps _a lot_ with playing partial or broken files, before
-forceidx would usually just stop at the first damage, now it usually
recognizes the whole file.
Ok to apply? Should the 1 MB be made an option or changed to some other
value?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/aviheader.c
===================================================================
--- libmpdemux/aviheader.c	(revision 24859)
+++ libmpdemux/aviheader.c	(working copy)
@@ -693,6 +693,7 @@
 #endif
 skip_chunk:
     skip=(len+1)&(~1UL); // total bytes in this chunk
+    if (skip > 1024 * 1024) skip = 0;
     stream_seek(demuxer->stream,8+demuxer->filepos+skip);
   }
   priv->idx_size=priv->idx_pos;


More information about the MPlayer-dev-eng mailing list