mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
e56d8a200d
GetTimer() is generally replaced with mp_time_us(). Both calls return microseconds, but the latter uses int64_t, us defined to never wrap, and never returns 0 or negative values. GetTimerMS() has no direct replacement. Instead the other functions are used. For some code, switch to mp_time_sec(), which returns the time as double float value in seconds. The returned time is offset to program start time, so there is enough precision left to deliver microsecond resolution for at least 100 years. Unless it's casted to a float (or the CPU reduces precision), which is why we still use mp_time_us() out of paranoia in places where precision is clearly needed. Always switch to the correct time. The whole point of the new timer calls is that they don't wrap, and storing microseconds in unsigned int variables would negate this. In some cases, remove wrap-around handling for time values. |
||
---|---|---|
.. | ||
getch2-win.c | ||
getch2.c | ||
getch2.h | ||
glob-win.c | ||
glob.h | ||
io.c | ||
io.h | ||
macosx_application_objc.h | ||
macosx_application.h | ||
macosx_application.m | ||
macosx_bundle.h | ||
macosx_bundle.m | ||
mmap_anon.c | ||
mmap_anon.h | ||
mmap.h | ||
mpv.exe.manifest | ||
mpv.rc | ||
numcores.c | ||
numcores.h | ||
priority.c | ||
priority.h | ||
shmem.c | ||
shmem.h | ||
timer-darwin.c | ||
timer-linux.c | ||
timer-win2.c | ||
timer.c | ||
timer.h |