]> git.sesse.net Git - vlc/commitdiff
avcodec: move xlib check to vaapi.c
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 10 Oct 2012 14:54:12 +0000 (17:54 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 12 Oct 2012 08:31:09 +0000 (11:31 +0300)
vlc_xlib_init() already checks for --no-xlib internally.

modules/codec/avcodec/vaapi.c
modules/codec/avcodec/video.c

index 29b245f785ca02c24b6be056d27e61a8ecc8d7d7..d98e041be0b926d7ee638ef339aa6b826d92c56c 100644 (file)
@@ -509,7 +509,10 @@ static void Delete( vlc_va_t *p_external )
 vlc_va_t *vlc_va_NewVaapi( vlc_object_t *obj, int i_codec_id )
 {
     if( !vlc_xlib_init( obj ) )
+    {
+        msg_Warn( obj, "Ignoring VA API" );
         return NULL;
+    }
 
     vlc_va_vaapi_t *p_va = calloc( 1, sizeof(*p_va) );
     if( !p_va )
index 1c1e94373e46d7eaf85e643e62ee1a89b09a2cde..e95977ef764fa940415958e413fdd8bc8be66c0f 100644 (file)
@@ -1161,23 +1161,17 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
         msg_Dbg( p_dec, "Available decoder output format %d (%s)", pi_fmt[i],
                  name ? name : "unknown" );
 
+#ifdef HAVE_AVCODEC_VAAPI
         /* Only VLD supported */
         if( pi_fmt[i] == PIX_FMT_VAAPI_VLD )
         {
-            if( !var_InheritBool( p_dec, "xlib" ) )
-            {
-                msg_Warn( p_dec, "Ignoring VA API" );
-                continue;
-            }
-#ifdef HAVE_AVCODEC_VAAPI
             msg_Dbg( p_dec, "Trying VA API" );
             p_sys->p_va = vlc_va_NewVaapi( VLC_OBJECT(p_dec), p_sys->i_codec_id );
             if( !p_sys->p_va )
                 msg_Warn( p_dec, "Failed to open VA API" );
-#else
-            continue;
-#endif
         }
+#endif
+
 #ifdef HAVE_AVCODEC_DXVA2
         if( pi_fmt[i] == PIX_FMT_DXVA2_VLD )
         {