[MPlayer-dev-eng] [PATCH] verbosity reduction around CPU flags
Diego Biurrun
diego at biurrun.de
Fri Nov 10 20:19:36 CET 2006
Here's a patch that makes MPlayer print info about the CPU flags it
encountered in verbose mode only. Note that the info is triplicated.
This should be refactored someday ...
Diego
-------------- next part --------------
Index: cpudetect.c
===================================================================
--- cpudetect.c (revision 20846)
+++ cpudetect.c (working copy)
@@ -149,9 +149,9 @@
ptmpstr=tmpstr=GetCpuFriendlyName(regs, regs2);
while(*ptmpstr == ' ') // strip leading spaces
ptmpstr++;
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: %s ", ptmpstr);
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: %s ", ptmpstr);
free(tmpstr);
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"(Family: %d, Model: %d, Stepping: %d)\n",
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"(Family: %d, Model: %d, Stepping: %d)\n",
caps->cpuType, caps->cpuModel, caps->cpuStepping);
}
@@ -577,47 +577,47 @@
}
#endif //__AMIGAOS4__
#endif /* SYS_DARWIN */
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
#endif /* HAVE_ALTIVEC */
#ifdef ARCH_IA64
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Intel Itanium\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Intel Itanium\n");
#endif
#ifdef ARCH_SPARC
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Sun Sparc\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Sun Sparc\n");
#endif
#ifdef ARCH_ARMV4L
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: ARM\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: ARM\n");
#endif
#ifdef ARCH_POWERPC
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: PowerPC\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: PowerPC\n");
#endif
#ifdef ARCH_ALPHA
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Digital Alpha\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Digital Alpha\n");
#endif
#ifdef ARCH_SGI_MIPS
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: SGI MIPS\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: SGI MIPS\n");
#endif
#ifdef ARCH_PA_RISC
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Hewlett-Packard PA-RISC\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Hewlett-Packard PA-RISC\n");
#endif
#ifdef ARCH_S390
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390\n");
#endif
#ifdef ARCH_S390X
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390X\n");
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390X\n");
#endif
#ifdef ARCH_VAX
- mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Digital VAX\n" );
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "CPU: Digital VAX\n" );
#endif
}
#endif /* !ARCH_X86 */
Index: mplayer.c
===================================================================
--- mplayer.c (revision 20846)
+++ mplayer.c (working copy)
@@ -2839,33 +2839,33 @@
/* Test for CPU capabilities (and corresponding OS support) for optimizing */
GetCpuCaps(&gCpuCaps);
#ifdef ARCH_X86
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
+ mp_msg(MSGT_CPLAYER,MSGL_V,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
#ifdef RUNTIME_CPUDETECT
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithRuntimeDetection);
#else
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithCPUExtensions);
#ifdef HAVE_MMX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX");
#endif
#ifdef HAVE_MMX2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX2");
#endif
#ifdef HAVE_3DNOW
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNow");
#endif
#ifdef HAVE_3DNOWEX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNowEx");
#endif
#ifdef HAVE_SSE
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE");
#endif
#ifdef HAVE_SSE2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE2");
#endif
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n");
+ mp_msg(MSGT_CPLAYER,MSGL_V,"\n");
#endif /* RUNTIME_CPUDETECT */
#endif /* ARCH_X86 */
Index: mencoder.c
===================================================================
--- mencoder.c (revision 20846)
+++ mencoder.c (working copy)
@@ -422,28 +422,28 @@
gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
#ifdef RUNTIME_CPUDETECT
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithRuntimeDetection);
#else
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithCPUExtensions);
#ifdef HAVE_MMX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX");
#endif
#ifdef HAVE_MMX2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX2");
#endif
#ifdef HAVE_3DNOW
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNow");
#endif
#ifdef HAVE_3DNOWEX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNowEx");
#endif
#ifdef HAVE_SSE
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE");
#endif
#ifdef HAVE_SSE2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE2");
#endif
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
+ mp_msg(MSGT_CPLAYER,MSGL_V,"\n");
#endif
#endif
Index: Gui/win32/gui.c
===================================================================
--- Gui/win32/gui.c (revision 20846)
+++ Gui/win32/gui.c (working copy)
@@ -113,28 +113,28 @@
gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
#ifdef RUNTIME_CPUDETECT
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithRuntimeDetection);
#else
- mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
+ mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithCPUExtensions);
#ifdef HAVE_MMX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX");
#endif
#ifdef HAVE_MMX2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
+ mp_msg(MSGT_CPLAYER,MSGL_V," MMX2");
#endif
#ifdef HAVE_3DNOW
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNow");
#endif
#ifdef HAVE_3DNOWEX
- mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
+ mp_msg(MSGT_CPLAYER,MSGL_V," 3DNowEx");
#endif
#ifdef HAVE_SSE
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE");
#endif
#ifdef HAVE_SSE2
- mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
+ mp_msg(MSGT_CPLAYER,MSGL_V," SSE2");
#endif
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
+ mp_msg(MSGT_CPLAYER,MSGL_V,"\n");
#endif
#endif
console_state = 1;
More information about the MPlayer-dev-eng
mailing list