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

D Richard Felker III dalias at aerifal.cx
Fri Oct 10 22:00:15 CEST 2003


On Fri, Oct 10, 2003 at 05:20:57PM +0200, Alban Bedel wrote:
> BTW this patch give an idea. Having mencoder write this separate
> index file regulary and mplayer re-read it everytime it change.
> With that it should be possible to seek in a "beeing recorded
> avi" :)
> Ok, it's hackish ;) But that's a lot easier that writing proper
> muxer, and optionaly demuxer, for a format that would support
> seeking without index.

IMO this is silly and unnecessary. Here's a better implementation:

When mencoder starts, seek to slightly before 4GB into the output file
and write a plenty space for an index (all zeros). Then mmap this
region of the file. Then just keep writing an updated index to the
mapped memory as you go. When mencoder exits, truncate the file at the
proper length and put a real index there, fixing the index offset in
the avi header. All decent filesystems have sparse file support, so
this won't use up any extra space on them. Of course the feature
should be optional (and disabled by default) for the few fools who
insist on dual-booting and using fat32/ntfs/whatever junk. :)

Rich




More information about the MPlayer-dev-eng mailing list