Commit 0b6ff97b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avcodec: move xlib check to vaapi.c

vlc_xlib_init() already checks for --no-xlib internally.
parent 88846171
...@@ -509,7 +509,10 @@ static void Delete( vlc_va_t *p_external ) ...@@ -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 ) vlc_va_t *vlc_va_NewVaapi( vlc_object_t *obj, int i_codec_id )
{ {
if( !vlc_xlib_init( obj ) ) if( !vlc_xlib_init( obj ) )
{
msg_Warn( obj, "Ignoring VA API" );
return NULL; return NULL;
}
vlc_va_vaapi_t *p_va = calloc( 1, sizeof(*p_va) ); vlc_va_vaapi_t *p_va = calloc( 1, sizeof(*p_va) );
if( !p_va ) if( !p_va )
......
...@@ -1161,23 +1161,17 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, ...@@ -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], msg_Dbg( p_dec, "Available decoder output format %d (%s)", pi_fmt[i],
name ? name : "unknown" ); name ? name : "unknown" );
#ifdef HAVE_AVCODEC_VAAPI
/* Only VLD supported */ /* Only VLD supported */
if( pi_fmt[i] == PIX_FMT_VAAPI_VLD ) 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" ); msg_Dbg( p_dec, "Trying VA API" );
p_sys->p_va = vlc_va_NewVaapi( VLC_OBJECT(p_dec), p_sys->i_codec_id ); p_sys->p_va = vlc_va_NewVaapi( VLC_OBJECT(p_dec), p_sys->i_codec_id );
if( !p_sys->p_va ) if( !p_sys->p_va )
msg_Warn( p_dec, "Failed to open VA API" ); msg_Warn( p_dec, "Failed to open VA API" );
#else
continue;
#endif
} }
#endif
#ifdef HAVE_AVCODEC_DXVA2 #ifdef HAVE_AVCODEC_DXVA2
if( pi_fmt[i] == PIX_FMT_DXVA2_VLD ) if( pi_fmt[i] == PIX_FMT_DXVA2_VLD )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment