[MPlayer-users] [feature/bug] rebuild index while playing

Rich Felker dalias at aerifal.cx
Wed Nov 2 19:43:52 CET 2005


On Wed, Nov 02, 2005 at 04:39:19PM +0100, Nico Sabbi wrote:
> Rich Felker wrote:
> 
> >>>
> >>>     
> >>>
> >>you can't implement timeshifting with a format such as avi without 
> >>horrible hacks.
> >>   
> >>
> >
> >yes you can. realtime index building is possible with any format that
> >can be played without index, and it's always the correct way to do it
> >since it adds no overhead (compared to -idx at startup which is slow
> >as hell).
> >
> >rich
> > 
> >
> 
> 
> how do you seek (that is the whole purpose of timeshifting) in an avi
> being played? building the index on the run (assuming it's possible) ?

Yes. Building the index is just a matter of parsing all the avi
frames. This work has already been done for all frames played so far,
so seeking to any part that's already been played is trivial if you
store this data in an index in memory.

Seeking into the future is slightly more work. You do just like -idx
would except you stop when you've gone far enough to reach the
destination point instead of going all the way to eof (so short seeks
forward are very fast).

Rich




More information about the MPlayer-users mailing list