va->close(va);
}
-vlc_va_t *vlc_va_NewVaapi(int codec_id);
+vlc_va_t *vlc_va_NewVaapi(vlc_object_t *obj, int codec_id);
vlc_va_t *vlc_va_NewDxva2(vlc_object_t *log, int codec_id);
#endif
#include <vlc_common.h>
#include <vlc_fourcc.h>
+#include <vlc_xlib.h>
#include <assert.h>
#ifdef HAVE_LIBAVCODEC_AVCODEC_H
}
/* */
-vlc_va_t *vlc_va_NewVaapi( int i_codec_id )
+vlc_va_t *vlc_va_NewVaapi( vlc_object_t *obj, int i_codec_id )
{
- bool fail;
-
- vlc_global_lock( VLC_XLIB_MUTEX );
- fail = !XInitThreads();
- vlc_global_unlock( VLC_XLIB_MUTEX );
- if( unlikely(fail) )
+ if( !vlc_xlib_init( obj ) )
return NULL;
vlc_va_vaapi_t *p_va = calloc( 1, sizeof(*p_va) );
}
#ifdef HAVE_AVCODEC_VAAPI
msg_Dbg( p_dec, "Trying VA API" );
- p_sys->p_va = vlc_va_NewVaapi( 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 )
msg_Warn( p_dec, "Failed to open VA API" );
#else