[MPlayer-dev-eng] [PATCH] 64-bit get time 2nd try

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Oct 10 22:55:26 CEST 2010


On Sun, Oct 10, 2010 at 07:24:33PM +0200, Dan Oscarsson wrote:
> sön 2010-10-10 klockan 16:15 +0200 skrev Reimar Döffinger:
> > > 
> > > Maybe I should use av_gettime as it supports 64-bit time values?
> > 
> > How should I know, you don't tell me what your requirements are (do
> > you even know?).
> > 0 is a wonderful 64 bit value, I doubt it meets most of your requirements
> > though.
> 
> Just like ffplay and vlc I use it to get a non wrapping timestamp. As
> av_gettime is implemented like my get_time, I could use it instead.
> 
> While most of my timestamp use can be re-written to use relative values,
> some require more thought.

I don't believe that using av_gettime will require any less thought.
Unless of course you're happy with an implementation that breaks whenever
something unexpect happens.

> One I can think of, is that in my code vo
> reports the time of last vsync it has seen. After a pause, which could
> take many hours, some vo do not update the last vsync time so after the
> pause a 32-bit value may have wrapped several times.This case I can fix
> - the vo have to, when requested to resume after a pause, wait for a
> vsync so it can report a current vsync timstamp.

Why do you think this needs any different handling than just starting playback?

> I have to carefully go
> through my code to see if there are other non-simple cases.

It seems unlikely to me that they would need more than a sanity check
and just restarting as on playback start to work reasonably well.
Even if wraparound was not handled at all otherwise, that would
only cause a slight vsync issue less than once per hour.


More information about the MPlayer-dev-eng mailing list