[MPlayer-users] Counter resets while playing DVD

Richard Körber m-mplayer at shredzone.de
Mon Dec 30 03:09:02 CET 2002


Hi!

> anyway it's not really usable. think of multiangle movies, or movies
> with optional scenes (ie you can play the 'cinema edit' and 'directors long
> cut' versions for example, it's still playing the same .VOBs but in one case
> it skips some parts of it -> counter will jump/reset there)

Well, I'm not really worried about counter jumps, as long as it only 
jumps forward, and is in sync again after that. The real problem are 
backward jumps and resets.

> but if it resets/jumps in the middle of a chapter then nothing helps. :(

Unfortunately it seems like it does... :-(

What about that: you store an internal timestamp offset, which is 
initialized by 0, and which is always added to the timestamp you got 
from the stream. If the stream timestamp resets, you just add the 
previous timestamp value to the offset variable.

Something like this (sorry, I'm out of practice with C):

   int offset = <initialized with 0>

   int timestamp = <timestamp from stream>
   int lasttimestamp;

   if(timestamp == 0) {   // Counter reset
     offset += lasttimestamp;
   }
   lasttimestamp = timestamp;

   output_timestamp( timestamp + offset );

Additionally, you could use the chapter timestamps in the IFO file to 
re-calculate the offset at the start of each chapter.

This should at least get rid of the counter resets, shouldn't it? :-)

Regards
-- 
Richard Körber -- m-mplayer at shredzone.de --




More information about the MPlayer-users mailing list