Commit 833f43cf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vaapi: do not retain version numbers

parent e59154b3
...@@ -75,10 +75,6 @@ struct vlc_va_sys_t ...@@ -75,10 +75,6 @@ struct vlc_va_sys_t
struct vaapi_context hw_ctx; struct vaapi_context hw_ctx;
/* */
int i_version_major;
int i_version_minor;
/* */ /* */
vlc_mutex_t lock; vlc_mutex_t lock;
int i_surface_count; int i_surface_count;
...@@ -136,6 +132,7 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count ) ...@@ -136,6 +132,7 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
} }
/* */ /* */
va->description = NULL;
sys->i_config_id = VA_INVALID_ID; sys->i_config_id = VA_INVALID_ID;
sys->i_context_id = VA_INVALID_ID; sys->i_context_id = VA_INVALID_ID;
sys->image.image_id = VA_INVALID_ID; sys->image.image_id = VA_INVALID_ID;
...@@ -155,12 +152,17 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count ) ...@@ -155,12 +152,17 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
goto error; goto error;
} }
if( vaInitialize( sys->p_display, &sys->i_version_major, &sys->i_version_minor ) ) int major, minor;
if( vaInitialize( sys->p_display, &major, &minor ) )
{ {
msg_Err( va, "Failed to initialize the VAAPI device" ); msg_Err( va, "Failed to initialize the VAAPI device" );
goto error; goto error;
} }
if( asprintf( &va->description, "VA API v%d.%d", major, minor ) < 0 )
va->description = NULL;
/* Check if the selected profile is supported */ /* Check if the selected profile is supported */
i_profiles_nb = vaMaxNumProfiles( sys->p_display ); i_profiles_nb = vaMaxNumProfiles( sys->p_display );
p_profiles_list = calloc( i_profiles_nb, sizeof( VAProfile ) ); p_profiles_list = calloc( i_profiles_nb, sizeof( VAProfile ) );
...@@ -210,14 +212,11 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count ) ...@@ -210,14 +212,11 @@ static int Open( vlc_va_t *va, int i_codec_id, int i_thread_count )
vlc_mutex_init(&sys->lock); vlc_mutex_init(&sys->lock);
if( asprintf( &va->description, "VA API version %d.%d",
sys->i_version_major, sys->i_version_minor ) < 0 )
va->description = NULL;
va->sys = sys; va->sys = sys;
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
free( va->description );
if( sys->p_display != NULL ) if( sys->p_display != NULL )
vaTerminate( sys->p_display ); vaTerminate( sys->p_display );
if( sys->p_display_x11 != NULL ) if( sys->p_display_x11 != NULL )
......
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