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)
*/
void system_Init(void)
{
#if !VLC_WINSTORE_APP
timeBeginPeriod(5);
#endif
if (system_InitWSA(2, 2) && system_InitWSA(1, 1))
fputs("Error: cannot initialize Winsocks\n", stderr);
......@@ -336,9 +338,9 @@ void system_End(void)
vlc_object_release (p_helper);
p_helper = NULL;
}
#endif
timeEndPeriod(5);
#endif
/* XXX: In theory, we should not call this if WSAStartup() failed. */
WSACleanup();
......
......@@ -651,6 +651,7 @@ static mtime_t mdate_tick (void)
static_assert ((CLOCK_FREQ % 1000) == 0, "Broken frequencies ratio");
return ts * (CLOCK_FREQ / 1000);
}
#if !VLC_WINSTORE_APP
#include <mmsystem.h>
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");
return ts * (CLOCK_FREQ / 1000);
}
#endif
static mtime_t mdate_perf (void)
{
......@@ -723,7 +725,11 @@ static void SelectClockSource (vlc_object_t *obj)
return;
}
#if !VLC_WINSTORE_APP
const char *name = "perf";
#else
const char *name = "multimedia";
#endif
char *str = var_InheritString (obj, "clock-source");
if (str != NULL)
name = str;
......@@ -755,6 +761,7 @@ static void SelectClockSource (vlc_object_t *obj)
#endif
mdate_selected = mdate_tick;
}
#if !VLC_WINSTORE_APP
else
if (!strcmp (name, "multimedia"))
{
......@@ -767,6 +774,7 @@ static void SelectClockSource (vlc_object_t *obj)
caps.wPeriodMin, caps.wPeriodMax);
mdate_selected = mdate_multimedia;
}
#endif
else
if (!strcmp (name, "perf"))
{
......@@ -825,9 +833,11 @@ size_t EnumClockSource (vlc_object_t *obj, const char *var,
names[n] = xstrdup ("Windows time");
n++;
}
#if !VLC_WINSTORE_APP
values[n] = xstrdup ("multimedia");
names[n] = xstrdup ("Multimedia timers");
n++;
#endif
values[n] = xstrdup ("perf");
names[n] = xstrdup ("Performance counters");
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