Skip to content
Snippets Groups Projects

win32: simplify the clock selection on startup

Merged Steve Lhomme requested to merge robUx4/vlc:win32-startup-clock into master
All threads resolved!
1 file
+ 1
2
Compare changes
  • Side-by-side
  • Inline
  • 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.
+ 1
2
@@ -583,8 +583,7 @@ static vlc_tick_t mdate_wall (void)
static vlc_tick_t mdate_default(void)
{
vlc_threads_setup(NULL);
return mdate_perf();
return mdate_wall();
}
static vlc_tick_t (*mdate_selected) (void) = mdate_default;
@@ -641,7+640,7 @@
char *str = NULL;
if (obj != NULL)
{
str = var_InheritString(obj, "clock-source");
if (str != NULL)
name = str;
}
Loading