Commit 2239e768 authored by Jean-Paul Saman's avatar Jean-Paul Saman

vaapi: fix profile detection

fixup: a47b657e
parent a47b657e
......@@ -86,9 +86,7 @@ static vlc_va_vaapi_t *vlc_va_vaapi_Get( void *p_va )
/* */
static int Open( vlc_va_vaapi_t *p_va, int i_codec_id, int i_count )
{
VAProfile i_profile, *p_profiles_list;
bool b_supported_profile = false;
int i_profiles_nb = 0;
VAProfile i_profile;
int i_surface_count;
/* NOTE: The number of surfaces requested is calculated
......@@ -147,15 +145,17 @@ static int Open( vlc_va_vaapi_t *p_va, int i_codec_id, int i_count )
p_va->conn->lock();
/* Check if the selected profile is supported */
i_profiles_nb = vaMaxNumEntrypoints( p_va->display );
p_profiles_list = malloc( i_profiles_nb * sizeof( VAProfile ) );
bool b_supported_profile = false;
int i_profiles_nb = vaMaxNumProfiles( p_va->conn->p_display );
VAProfile *p_profiles_list = calloc( i_profiles_nb, sizeof( VAProfile ) );
if ( !p_profiles_list )
goto error;
if ( vaQueryConfigProfiles( p_va->display, p_profiles_list, &i_profiles_nb ) == VA_STATUS_SUCCESS )
VAStatus status = vaQueryConfigProfiles( p_va->conn->p_display, p_profiles_list, &i_profiles_nb );
if ( status == VA_STATUS_SUCCESS )
{
while( --i_profiles_nb >= 0 )
for ( int i = 0; i < i_profiles_nb; i++ )
{
if ( p_profiles_list[i_profiles_nb] == i_profile )
if ( p_profiles_list[i] == i_profile )
{
b_supported_profile = true;
break;
......
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