From 00e3391bae63beb1644db3a450569dfb256fe40c Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 3 Oct 2005 19:11:55 +0000 Subject: expGetSystemInfo should not leave SYSTEM_INFO unitialized, even when /proc/cpuinfo is unreadable. Fixes some weird behaviour with the wmv decoder (it tries multithreaded decode). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16651 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/loader/win32.c b/loader/win32.c index 55524a5efe..3a507f148a 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -938,9 +938,7 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si) dbgprintf("GetSystemInfo(%p) =>\n", si); if (cache) { - memcpy(si,&cachedsi,sizeof(*si)); - DumpSystemInfo(si); - return; + goto exit; } memset(PF,0,sizeof(PF)); pf_set = 1; @@ -1036,7 +1034,14 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si) FILE *f = fopen ("/proc/cpuinfo", "r"); if (!f) - return; + { +#ifdef MPLAYER + mp_msg(MSGT_WIN32, MSGL_WARN, "expGetSystemInfo: " + "/proc/cpuinfo not readable! " + "Expect bad performance and/or weird behaviour\n"); +#endif + goto exit; + } while (fgets(line,200,f)!=NULL) { char *s,*value; @@ -1162,6 +1167,7 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si) } #endif /* __linux__ */ cache = 1; +exit: memcpy(si,&cachedsi,sizeof(*si)); DumpSystemInfo(si); } -- cgit v1.2.3