[MPlayer-dev-eng] GetTimerMS overflow

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Mar 2 23:50:52 CET 2014


On Sun, Mar 02, 2014 at 11:24:21PM +0100, Hans-Dieter Kosch wrote:
> compn wrote:
> 
> >On Sun, 02 Mar 2014 18:03:44 +0100
> >Jarek Czekalski <jarekczek at poczta.onet.pl> wrote:
> >>I would like to know what steps do you suggest to solve these
> >>problems. Should I send a patch to fix that?
> >
> >stop changing your clock when viewing films/tv hehe :P
> 
> I had a similar problem in my job and solved it by using
> setitimer(ITIMER_REAL, ...)/getitimer(ITIMER_REAL, ...) instead of
> gettimeofday(). However, it's a bit tricky and it entails changing
> all code depending on it; but it works perfectly (my systems are
> running 24/7).
> 
> If somebody is interested, I'll explain details.

I don't think that is any more portable (and in fact seems to be
deprecated).
Yes, it is possible to solve it in such or similar ways if really
necessary.
However MPlayer does not need to accurate timing over timescales of
multiple days or more (in fact for several reasons it should probably
at most be inactive for seconds at a time), and thus it _should_ not
generally have any issues with jumping clocks in the first place beyond
possibly a few-second stutter.
Fixing any specific mis-behaviour will benefit all OS and be perfectly
portable instead of introducing code that will randomly work for user A
but not user B.
That doesn't mean I'll categorically refuse to consider other options,
but reproducing and fixing any issues by additional sanity checks seems
vastly preferable to me.


More information about the MPlayer-dev-eng mailing list