[MPlayer-dev-eng] GetTimerMS overflow
jarekczek at poczta.onet.pl
Sun Mar 2 18:03:44 CET 2014
While working on the bug #2174  I discovered that timestamp handling
in mplayer is probably broken.
1. It is vulnerable to time changes (daylight saving) twice a year
2. It suffers from overflows
Monotonic clock should be used instead of real time clock. That is
get_clocktime(CLOCK_MONOTONIC)  instead of gettimeofday 
long long values should hold number of milli- and microseconds, as it is
done in stream/tvi_v4l2.c. The private library function GetTimerMS
(osdep/timer-linux.c) uses unsigned int for this purpose. This easily
overflows, because current time in seconds is 1 393 778 888, which
hardly fits in 32-bit integer. After multiplying by 1K or 1M we are
overflowed. If my calculations are correct, that means GetTimerMS starts
from 0 every 4000 seconds.
I would like to know what steps do you suggest to solve these problems.
Should I send a patch to fix that?
More information about the MPlayer-dev-eng