[MPlayer-dev-eng] [PATCH] 64-bit get time 2nd try
Dan Oscarsson
Dan.Oscarsson at tieto.com
Sun Oct 17 18:20:54 CEST 2010
mån 2010-10-11 klockan 19:56 +0200 skrev Reimar Döffinger:
>
> If possible I prefer code that figures out on its own that something is
> fishy and compensates (where "possible" for me implies that the result
> of this "intelligence" will never be significantly worse than not having it),
> which ideally would handle startup, vsync changes during both playback and
> pause and whatever else might go wrong with timing.
Yes, that would be nice, I generally try to do that.
Having worked on my code to use 32-bit wrapping timestamps instead of
64-bit time stamps, I have so far found two cases where I have not yet
decided on best way to do it.
1) I record last vsync I have output a frame to. Best way I have is time
of vsync. Now when I use 32-bit timestamps, this value may wrap during a
very long pause. If it wraps and my tests for wrapped values misses,
there may be several dropped video frames. As I guess people seldom do a
very long pause it may not matter.
2) For some timestamps I used the value 0 to mean "first time", as
timestamps now wrap and may have 0 anytime, I will have to use a
separate variable for each timestamp where I need to maintain state for
"first time".
Otherwise it looks good so far.
Dan
More information about the MPlayer-dev-eng
mailing list