From 13b5c2e513f6a6868e2bab4b54b3f298abea4f5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 22 Sep 2009 18:13:36 +0300 Subject: [PATCH] LibVLC: only print relevant capabilities in debug --- src/libvlc.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/libvlc.c b/src/libvlc.c index d216bb74b6..36391933f2 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -298,7 +298,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, const char *ppsz_argv[] ) { libvlc_priv_t *priv = libvlc_priv (p_libvlc); - char p_capabilities[200]; char * p_tmp = NULL; char * psz_modules = NULL; char * psz_parser = NULL; @@ -740,6 +739,16 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, if( !config_GetInt( p_libvlc, "fpu" ) ) cpu_flags &= ~CPU_CAPABILITY_FPU; + char p_capabilities[200]; +#define PRINT_CAPABILITY( capability, string ) \ + if( vlc_CPU() & capability ) \ + { \ + strncat( p_capabilities, string " ", \ + sizeof(p_capabilities) - strlen(p_capabilities) ); \ + p_capabilities[sizeof(p_capabilities) - 1] = '\0'; \ + } + p_capabilities[0] = '\0'; + #if defined( __i386__ ) || defined( __x86_64__ ) if( !config_GetInt( p_libvlc, "mmx" ) ) cpu_flags &= ~CPU_CAPABILITY_MMX; @@ -751,27 +760,24 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, cpu_flags &= ~CPU_CAPABILITY_SSE; if( !config_GetInt( p_libvlc, "sse2" ) ) cpu_flags &= ~CPU_CAPABILITY_SSE2; -#endif -#if defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ ) - if( !config_GetInt( p_libvlc, "altivec" ) ) - cpu_flags &= ~CPU_CAPABILITY_ALTIVEC; -#endif - -#define PRINT_CAPABILITY( capability, string ) \ - if( vlc_CPU() & capability ) \ - { \ - strncat( p_capabilities, string " ", \ - sizeof(p_capabilities) - strlen(p_capabilities) ); \ - p_capabilities[sizeof(p_capabilities) - 1] = '\0'; \ - } - p_capabilities[0] = '\0'; PRINT_CAPABILITY( CPU_CAPABILITY_MMX, "MMX" ); PRINT_CAPABILITY( CPU_CAPABILITY_3DNOW, "3DNow!" ); PRINT_CAPABILITY( CPU_CAPABILITY_MMXEXT, "MMXEXT" ); PRINT_CAPABILITY( CPU_CAPABILITY_SSE, "SSE" ); PRINT_CAPABILITY( CPU_CAPABILITY_SSE2, "SSE2" ); + +#elif defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc64__ ) + if( !config_GetInt( p_libvlc, "altivec" ) ) + cpu_flags &= ~CPU_CAPABILITY_ALTIVEC; + PRINT_CAPABILITY( CPU_CAPABILITY_ALTIVEC, "AltiVec" ); + +#elif defined( __arm__ ) + PRINT_CAPABILITY( CPU_CAPABILITY_NEON, "NEONv1" ); + +#endif + PRINT_CAPABILITY( CPU_CAPABILITY_FPU, "FPU" ); msg_Dbg( p_libvlc, "CPU has capabilities %s", p_capabilities ); -- 2.39.2