1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 01:22:30 +00:00
mpv/osdep
wm4 e56d8a200d Replace all calls to GetTimer()/GetTimerMS()
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.
2013-05-26 16:44:20 +02:00
..
getch2-win.c Prefix keycode defines with MP_ 2013-02-12 10:27:00 +01:00
getch2.c mp_msg: fix status output disappearing when redirecting INPUT. 2013-03-18 20:33:29 +01:00
getch2.h mp_msg, getch2: unix tty background support 2013-01-23 18:05:34 +01:00
glob-win.c osdep:/glob-win.c: reformat 2012-08-03 01:31:32 +02:00
glob.h
io.c windows support: fix _wstat misusage 2013-01-13 17:32:39 +01:00
io.h windows support: fix _wstat misusage 2013-01-13 17:32:39 +01:00
macosx_application_objc.h OSX: run native event loop in a separate thread 2013-05-12 15:27:54 +02:00
macosx_application.h macosx_application: implement "Quit & remember position" 2013-05-23 20:07:14 +02:00
macosx_application.m macosx_application: implement "Quit & remember position" 2013-05-23 20:07:14 +02:00
macosx_bundle.h path: add mp_find_config_file and reorganize some of the code 2012-12-15 17:38:00 +01:00
macosx_bundle.m path: add mp_find_config_file and reorganize some of the code 2012-12-15 17:38:00 +01:00
mmap_anon.c
mmap_anon.h
mmap.h
mpv.exe.manifest build: fix compilation on Windows (manifest files) 2012-10-20 20:03:13 +02:00
mpv.rc Update copyright year 2013-01-04 15:23:23 +01:00
numcores.c vd_ffmpeg: set thread count to number of cores on machine by default 2010-12-20 05:53:28 +02:00
numcores.h vd_ffmpeg: set thread count to number of cores on machine by default 2010-12-20 05:53:28 +02:00
priority.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
priority.h
shmem.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
shmem.h cache2: allow cache sizes up to 4 TB 2012-08-03 01:52:40 +02:00
timer-darwin.c timer: refactor, add 64 bit timer function 2013-05-26 16:44:20 +02:00
timer-linux.c timer: refactor, add 64 bit timer function 2013-05-26 16:44:20 +02:00
timer-win2.c timer: use gettimeofday() on Windows 2013-05-26 16:44:20 +02:00
timer.c Replace all calls to GetTimer()/GetTimerMS() 2013-05-26 16:44:20 +02:00
timer.h Replace all calls to GetTimer()/GetTimerMS() 2013-05-26 16:44:20 +02:00