libs: decoder: release VA buffers after vaEndPicture

This change is due a problem decoding JPEGs with Intel's media-driver:
no image was generated.

This patch relases the VA buffers after vaEndPicture() is called,
and not before (after vaRenderPicture()).

https://bugzilla.gnome.org/show_bug.cgi?id=796505
This commit is contained in:
Tianhao Liu 2018-06-07 09:34:11 +08:00 committed by Víctor Manuel Jáquez Leal
parent e31248dc28
commit bb8894aaf9

View file

@ -304,12 +304,17 @@ gst_vaapi_picture_decode (GstVaapiPicture * picture)
status = vaRenderPicture (va_display, va_context, va_buffers, 2); status = vaRenderPicture (va_display, va_context, va_buffers, 2);
if (!vaapi_check_status (status, "vaRenderPicture()")) if (!vaapi_check_status (status, "vaRenderPicture()"))
return FALSE; return FALSE;
}
status = vaEndPicture (va_display, va_context);
for (i = 0; i < picture->slices->len; i++) {
GstVaapiSlice *const slice = g_ptr_array_index (picture->slices, i);
vaapi_destroy_buffer (va_display, &slice->param_id); vaapi_destroy_buffer (va_display, &slice->param_id);
vaapi_destroy_buffer (va_display, &slice->data_id); vaapi_destroy_buffer (va_display, &slice->data_id);
} }
status = vaEndPicture (va_display, va_context);
if (!vaapi_check_status (status, "vaEndPicture()")) if (!vaapi_check_status (status, "vaEndPicture()"))
return FALSE; return FALSE;
return TRUE; return TRUE;