Commit 3ac2b4f9 authored by Rafaël Carré's avatar Rafaël Carré

Do not use multimedia timers in WinStore app

parent d744f13b
...@@ -56,7 +56,9 @@ static int system_InitWSA(int hi, int lo) ...@@ -56,7 +56,9 @@ static int system_InitWSA(int hi, int lo)
*/ */
void system_Init(void) void system_Init(void)
{ {
#if !VLC_WINSTORE_APP
timeBeginPeriod(5); timeBeginPeriod(5);
#endif
if (system_InitWSA(2, 2) && system_InitWSA(1, 1)) if (system_InitWSA(2, 2) && system_InitWSA(1, 1))
fputs("Error: cannot initialize Winsocks\n", stderr); fputs("Error: cannot initialize Winsocks\n", stderr);
...@@ -336,9 +338,9 @@ void system_End(void) ...@@ -336,9 +338,9 @@ void system_End(void)
vlc_object_release (p_helper); vlc_object_release (p_helper);
p_helper = NULL; p_helper = NULL;
} }
#endif
timeEndPeriod(5); timeEndPeriod(5);
#endif
/* XXX: In theory, we should not call this if WSAStartup() failed. */ /* XXX: In theory, we should not call this if WSAStartup() failed. */
WSACleanup(); WSACleanup();
......
...@@ -651,6 +651,7 @@ static mtime_t mdate_tick (void) ...@@ -651,6 +651,7 @@ static mtime_t mdate_tick (void)
static_assert ((CLOCK_FREQ % 1000) == 0, "Broken frequencies ratio"); static_assert ((CLOCK_FREQ % 1000) == 0, "Broken frequencies ratio");
return ts * (CLOCK_FREQ / 1000); return ts * (CLOCK_FREQ / 1000);
} }
#if !VLC_WINSTORE_APP
#include <mmsystem.h> #include <mmsystem.h>
static mtime_t mdate_multimedia (void) static mtime_t mdate_multimedia (void)
{ {
...@@ -660,6 +661,7 @@ static mtime_t mdate_multimedia (void) ...@@ -660,6 +661,7 @@ static mtime_t mdate_multimedia (void)
static_assert ((CLOCK_FREQ % 1000) == 0, "Broken frequencies ratio"); static_assert ((CLOCK_FREQ % 1000) == 0, "Broken frequencies ratio");
return ts * (CLOCK_FREQ / 1000); return ts * (CLOCK_FREQ / 1000);
} }
#endif
static mtime_t mdate_perf (void) static mtime_t mdate_perf (void)
{ {
...@@ -723,7 +725,11 @@ static void SelectClockSource (vlc_object_t *obj) ...@@ -723,7 +725,11 @@ static void SelectClockSource (vlc_object_t *obj)
return; return;
} }
#if !VLC_WINSTORE_APP
const char *name = "perf";
#else
const char *name = "multimedia"; const char *name = "multimedia";
#endif
char *str = var_InheritString (obj, "clock-source"); char *str = var_InheritString (obj, "clock-source");
if (str != NULL) if (str != NULL)
name = str; name = str;
...@@ -755,6 +761,7 @@ static void SelectClockSource (vlc_object_t *obj) ...@@ -755,6 +761,7 @@ static void SelectClockSource (vlc_object_t *obj)
#endif #endif
mdate_selected = mdate_tick; mdate_selected = mdate_tick;
} }
#if !VLC_WINSTORE_APP
else else
if (!strcmp (name, "multimedia")) if (!strcmp (name, "multimedia"))
{ {
...@@ -767,6 +774,7 @@ static void SelectClockSource (vlc_object_t *obj) ...@@ -767,6 +774,7 @@ static void SelectClockSource (vlc_object_t *obj)
caps.wPeriodMin, caps.wPeriodMax); caps.wPeriodMin, caps.wPeriodMax);
mdate_selected = mdate_multimedia; mdate_selected = mdate_multimedia;
} }
#endif
else else
if (!strcmp (name, "perf")) if (!strcmp (name, "perf"))
{ {
...@@ -825,9 +833,11 @@ size_t EnumClockSource (vlc_object_t *obj, const char *var, ...@@ -825,9 +833,11 @@ size_t EnumClockSource (vlc_object_t *obj, const char *var,
names[n] = xstrdup ("Windows time"); names[n] = xstrdup ("Windows time");
n++; n++;
} }
#if !VLC_WINSTORE_APP
values[n] = xstrdup ("multimedia"); values[n] = xstrdup ("multimedia");
names[n] = xstrdup ("Multimedia timers"); names[n] = xstrdup ("Multimedia timers");
n++; n++;
#endif
values[n] = xstrdup ("perf"); values[n] = xstrdup ("perf");
names[n] = xstrdup ("Performance counters"); names[n] = xstrdup ("Performance counters");
n++; n++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment