[MPlayer-dev-eng] [PATCH] Saved AVI index files with -saveidx and -idxfile

Jason Tackaberry tack at auc.ca
Wed Oct 1 18:21:50 CEST 2003


Last week I asked if it was possible to save indexes generated by
-forceidx to a separate file so they could later be read in.  This will
at least provide a kludge around the inability to seek in AVIs bigger
than 2G (without reindexing every time).  Attila suggested it should be
doable, so I gave it a whirl.  

Attached is a patch against cvs MAIN which does just that.  This patch
is very hackish: it is not very robust (it does no sanity checking on
the index files) and it does things it shouldn't be doing in libmpdemux
(like calling exit()).  I don't expect it to be merged into cvs without
changes (or at all), but I do expect others will find it useful.

This patch provides two additional options to mplayer: -saveidx and
-idxfile.

        -saveidx: when specified, mplayer will generate an index file
        for the given AVI file and quit
        
        -idxfile <file>: the filename for the index to be read/written.
        If specifed with -saveidx, the file is written, otherwise it is
        read.
        
e.g.
	mplayer avi_bigger_than_2g.avi -saveidx -idxfile foo.idx
	mplayer avi_bigger_than_2g.avi -idxfile foo.idx

Some day mencoder and mplayer will support ODML and I won't need this
hack.  I'm really looking forward to that day. :)

If indeed there is interest in merging this into CVS, I'd be happy to
make the necessary changes, but may need some direction.  On the other
hand, it's probably trivial enough for the mplayer gurus to fix
themselves.

Cheers,
Jason.

-- 
Jason Tackaberry  ::  tack at auc.ca  :: 705-949-2301 x330 
Academic Computing Support Specialist
Information Technology Services
Algoma University College  ::  www.auc.ca

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-saved-indexes.patch
Type: text/x-patch
Size: 3408 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20031001/3a671273/attachment.bin>


More information about the MPlayer-dev-eng mailing list