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

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


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

Win32: use GetNativeSystemInfo to the processor count

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

 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