mirror of https://github.com/mpv-player/mpv
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.)
This commit is contained in:
parent
cbaa8d65fc
commit
ac879545ad
|
@ -52,15 +52,7 @@ uint64_t mp_raw_time_us(void)
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
void mp_raw_time_init(void)
|
||||||
{
|
{
|
||||||
timeBeginPeriod(1); // request 1ms timer resolution
|
timeBeginPeriod(1); // request 1ms timer resolution
|
||||||
atexit(restore_timer);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue