]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/ffmpeg.c: avoid a strcmp() in LibavcodecCallback().
authorGildas Bazin <gbazin@videolan.org>
Sun, 30 Oct 2005 19:50:14 +0000 (19:50 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 30 Oct 2005 19:50:14 +0000 (19:50 +0000)
modules/codec/ffmpeg/ffmpeg.c

index 8fde0aff4350ad500a52ca438ef1f5bfd6f8879c..e6a4ed86a8aab4f9c6342d1c21154e87344f9816 100644 (file)
@@ -338,13 +338,16 @@ static void LibavcodecCallback( void *p_opaque, int i_level,
 
     p_avc = p_avctx ? p_avctx->av_class : 0;
 
+#define cln p_avc->class_name
     /* Make sure we can get p_this back */
-    if( !p_avctx || !p_avc || !p_avc->class_name ||
-        strcmp( p_avc->class_name, "AVCodecContext" ) )
+    if( !p_avctx || !p_avc || !cln ||
+        cln[0]!='A' || cln[1]!='V' || cln[2]!='C' || cln[3]!='o' ||
+        cln[4]!='d' || cln[5]!='e' || cln[6]!='c' )
     {
         if( i_level == AV_LOG_ERROR ) vfprintf( stderr, psz_format, va );
         return;
     }
+#undef cln
 
     p_this = (vlc_object_t *)p_avctx->opaque;