context: fix get_attribute() value result.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 23 Jan 2014 10:44:12 +0000 (11:44 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 23 Jan 2014 13:29:09 +0000 (14:29 +0100)
Unknown attributes, or attributes that are not supported for the given
profile/entrypoint pair have a return value of VA_ATTRIB_NOT_SUPPORTED.
So, return failure in this case.

gst-libs/gst/vaapi/gstvaapicontext.c

index 8651e90..7524b51 100644 (file)
@@ -425,6 +425,8 @@ gst_vaapi_context_get_attribute (GstVaapiContext * context,
   GST_VAAPI_OBJECT_UNLOCK_DISPLAY (context);
   if (!vaapi_check_status (status, "vaGetConfigAttributes()"))
     return FALSE;
+  if (attrib.value == VA_ATTRIB_NOT_SUPPORTED)
+    return FALSE;
 
   if (out_value_ptr)
     *out_value_ptr = attrib.value;