[vlc-commits] vaapi: do not retain version numbers

Rémi Denis-Courmont git at videolan.org
Sat Mar 22 17:15:31 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 22 16:09:12 2014 +0200| [833f43cfb5e5ac0e19fa3630dcad4d50a21f4e2a] | committer: Rémi Denis-Courmont

vaapi: do not retain version numbers

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

 modules/codec/avcodec/vaapi.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index bcad3fa..c85e122 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -76,10 +76,6 @@ struct vlc_va_sys_t
     struct vaapi_context hw_ctx;
 
     /* */
-    int i_version_major;
-    int i_version_minor;
-
-    /* */
     vlc_mutex_t  lock;
     int          i_surface_count;
     unsigned int i_surface_order;
@@ -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_context_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 )
         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" );
         goto error;
     }
 
+    if( asprintf( &va->description, "VA API v%d.%d", major, minor ) < 0 )
+        va->description = NULL;
+
     /* Check if the selected profile is supported */
     i_profiles_nb = vaMaxNumProfiles( sys->p_display );
     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 )
 
     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;
     return VLC_SUCCESS;
 
 error:
+    free( va->description );
     if( sys->p_display != NULL )
         vaTerminate( sys->p_display );
     if( sys->p_display_x11 != NULL )



More information about the vlc-commits mailing list