Revert "gstvaapisurface_drm: release image when done"

This reverts commit 1dbcc8a0e1  and commit
372a03a9e3.

While the dmabuf handle is exported, the derive image must exist, otherwise
the image's VA buffer is invalid, thus the dmabuf handle is never released,
leading into a file descriptors leak.
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-07-19 17:43:28 +02:00
parent 3efc2f70b7
commit 7472826a36

View file

@ -36,19 +36,11 @@ gst_vaapi_surface_get_drm_buf_handle (GstVaapiSurface * surface, guint type)
if (!image)
goto error_derive_image;
if (type == GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) {
proxy = gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface),
image->internal_image.buf, type, NULL, NULL);
} else {
proxy = gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface),
image->internal_image.buf, type, gst_vaapi_object_unref, image);
}
proxy =
gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface),
image->internal_image.buf, type, gst_vaapi_object_unref, image);
if (!proxy)
goto error_alloc_export_buffer;
if (type == GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF)
gst_vaapi_object_unref (image);
return proxy;
/* ERRORS */