[vlc-commits] Win32: use GetNativeSystemInfo to get the processor count

Jean-Baptiste Kempf git at videolan.org
Tue Jan 22 13:47:21 CET 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jan 22 12:23:44 2013 +0100| [8378d01f5e99bb3fc89d80a98f5d70f84ccfc989] | committer: Jean-Baptiste Kempf

Win32: use GetNativeSystemInfo to get the processor count

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8378d01f5e99bb3fc89d80a98f5d70f84ccfc989
---

 src/win32/thread.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/win32/thread.c b/src/win32/thread.c
index 5830d00..451aa39 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -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;
 }
 
 



More information about the vlc-commits mailing list