[vlc-commits] Do not use multimedia timers in WinStore app
Rafaël Carré
git at videolan.org
Thu Apr 25 19:05:28 CEST 2013
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Apr 22 19:47:08 2013 +0200| [3ac2b4f96620d58afec918c57270dab3eb41f476] | committer: Rafaël Carré
Do not use multimedia timers in WinStore app
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3ac2b4f96620d58afec918c57270dab3eb41f476
---
src/win32/specific.c | 4 +++-
src/win32/thread.c | 10 ++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/win32/specific.c b/src/win32/specific.c
index 0058734..499a20c 100644
--- a/src/win32/specific.c
+++ b/src/win32/specific.c
@@ -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();
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 1744b08..e60be86 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -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++;
More information about the vlc-commits
mailing list