[vlc-devel] commit: LibVLC: only print relevant capabilities in debug ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Sep 22 17:22:49 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Sep 22 18:13:36 2009 +0300| [13b5c2e513f6a6868e2bab4b54b3f298abea4f5a] | committer: Rémi Denis-Courmont 

LibVLC: only print relevant capabilities in debug

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

 src/libvlc.c |   36 +++++++++++++++++++++---------------
 1 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index d216bb7..3639193 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 );
 




More information about the vlc-devel mailing list