win32: simplify the clock selection on startup
All threads resolved!
All threads resolved!
Compare changes
- Steve Lhomme authored
It relies on clk.perf.freq.QuadPart which is uninitialized and unknown until SelectClockSource() is called. So it calls vlc_threads_setup() each time until vlc_threads_setup() is called with the libvlc instance. Except vlc_threads_setup(NULL) will crash on the var_InheritBool(vlc, "high-priority") call. Usable candidates at startup are: * mdate_interrupt which is a counter in 100 ns, not a wall clock * mdate_tick which is a counter in 1 ms, not a wall clock * mdate_perf_100ns which is a clock in 100 ns but we don't know if the system uses that resolution * mdate_wall which is a clock in 100 ns resolution (slowest) mdate_wall gives the better results and should provide a safe transition with mdate_perf/mdate_perf_100ns values.
+ 11
− 31
@@ -43,6 +43,10 @@
@@ -526,7 +530,7 @@ static vlc_tick_t mdate_interrupt (void)
@@ -577,13 +581,7 @@ static vlc_tick_t mdate_wall (void)
@@ -631,16 +629,10 @@ void (vlc_tick_sleep)(vlc_tick_t delay)
@@ -676,7 +668,6 @@ static BOOL SelectClockSource(vlc_object_t *obj)
@@ -692,22 +683,12 @@ unsigned vlc_GetCPUCount (void)
@@ -721,7 +702,6 @@ void vlc_threads_setup(libvlc_int_t *vlc)