From 0861862b897ade9e62064f532f3b0a957ee7a0d8 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Tue, 29 Sep 2015 18:11:03 +0800 Subject: winrt: multithreading support _beginthreadex is for desktop only. CreateThread is available for windows store apps on windows (and phone) 8.1 and later. http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx Signed-off-by: Matt Oliver --- libavutil/cpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libavutil') diff --git a/libavutil/cpu.c b/libavutil/cpu.c index 780368d69e..c64baf9324 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -30,7 +30,7 @@ #endif #include #endif -#if HAVE_GETPROCESSAFFINITYMASK +#if HAVE_GETPROCESSAFFINITYMASK || HAVE_WINRT #include #endif #if HAVE_SYSCTL @@ -253,6 +253,9 @@ int av_cpu_count(void) static volatile int printed; int nb_cpus = 1; +#if HAVE_WINRT + SYSTEM_INFO sysinfo; +#endif #if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT) cpu_set_t cpuset; @@ -274,6 +277,9 @@ int av_cpu_count(void) nb_cpus = sysconf(_SC_NPROC_ONLN); #elif HAVE_SYSCONF && defined(_SC_NPROCESSORS_ONLN) nb_cpus = sysconf(_SC_NPROCESSORS_ONLN); +#elif HAVE_WINRT + GetNativeSystemInfo(&sysinfo); + nb_cpus = sysinfo.dwNumberOfProcessors; #endif if (!printed) { -- cgit v1.2.3