[vlc-commits] avcodec: move xlib check to vaapi.c

Rémi Denis-Courmont git at videolan.org
Fri Oct 12 10:38:14 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct 10 17:54:12 2012 +0300| [0b6ff97b678b5c6075fd76a1a8890b7f3ed17ff4] | committer: Rémi Denis-Courmont

avcodec: move xlib check to vaapi.c

vlc_xlib_init() already checks for --no-xlib internally.

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

 modules/codec/avcodec/vaapi.c |    3 +++
 modules/codec/avcodec/video.c |   12 +++---------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 29b245f..d98e041 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -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 )
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 1c1e943..e95977e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -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 )
         {



More information about the vlc-commits mailing list