]> git.sesse.net Git - vlc/commitdiff
Win32: use GetNativeSystemInfo to get the processor count
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 22 Jan 2013 11:23:44 +0000 (12:23 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 22 Jan 2013 12:47:10 +0000 (13:47 +0100)
src/win32/thread.c

index 5830d00b37461704fdcf929b2c9f1c9a51d0b2b4..451aa39666856cb342ca62e8826f887167eb5038 100644 (file)
@@ -909,12 +909,11 @@ unsigned vlc_timer_getoverrun (vlc_timer_t timer)
 /*** CPU ***/
 unsigned vlc_GetCPUCount (void)
 {
-    DWORD_PTR process;
-    DWORD_PTR system;
+    SYSTEM_INFO systemInfo;
 
-    if (GetProcessAffinityMask (GetCurrentProcess(), &process, &system))
-        return popcount (system);
-     return 1;
+    GetNativeSystemInfo(&systemInfo);
+
+    return systemInfo.dwNumberOfProcessors;
 }