win32: increase hires timer resolution

timeBeginPeriod() only allows setting minimum timer resolution
to 1 ms. However, modern x86 platforms support a minimum timer
resolution of 0.5 ms. Use NtSetTimerResolution() instead for
the increased resolution, which can be set with MPV_HRT_RES.

Additionally, change the units of mp_start_hires_timers(),
mp_end_hires_timer(), MPV_HRT_RES, and MPV_HRT_MAX to nanoseconds,
in accordance with other functions used in timer.h.
This commit is contained in:
nanahi
2023-10-26 15:13:12 -04:00
committed by Kacper Michajłow
parent bfd016d101
commit aff376e066
5 changed files with 40 additions and 21 deletions

View File

@@ -497,6 +497,7 @@ if features['win32-desktop']
cc.find_library('dwmapi'),
cc.find_library('gdi32'),
cc.find_library('imm32'),
cc.find_library('ntdll'),
cc.find_library('ole32'),
cc.find_library('uuid'),
cc.find_library('uxtheme'),