summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-21 22:52:14 +0200
committerwm4 <wm4@nowhere>2015-05-21 22:52:14 +0200
commitac879545ada48eb47cf5e56625fc00a403283890 (patch)
treeb608b9b498bb42c77494b976cdd5a7289b3d88a8
parentcbaa8d65fc17994f542f16eb2479ac4cd4621262 (diff)
downloadmpv-ac879545ada48eb47cf5e56625fc00a403283890.tar.bz2
mpv-ac879545ada48eb47cf5e56625fc00a403283890.tar.xz
win32: do not call timeEndPeriod(1) on termination
This was called for formal reasons at best. The way it does this is somewhat dangerous, because if libmpv is unloaded as DLL, this would attempt to call a dangling function pointer. (No, we don't want an extra DllMain entrypoint just for win32.)
-rw-r--r--osdep/timer-win2.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/osdep/timer-win2.c b/osdep/timer-win2.c
index b87456f3ce..b58379d312 100644
--- a/osdep/timer-win2.c
+++ b/osdep/timer-win2.c
@@ -52,15 +52,7 @@ uint64_t mp_raw_time_us(void)
}
#endif
-static void restore_timer(void)
-{
- // The MSDN documents that begin/end "must" be matched. This satisfies
- // this requirement.
- timeEndPeriod(1);
-}
-
void mp_raw_time_init(void)
{
timeBeginPeriod(1); // request 1ms timer resolution
- atexit(restore_timer);
}