diff --git a/gst-libs/gst/vaapi/gstvaapisurface_drm.c b/gst-libs/gst/vaapi/gstvaapisurface_drm.c index 371f05dc09..f4364a3315 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface_drm.c +++ b/gst-libs/gst/vaapi/gstvaapisurface_drm.c @@ -36,14 +36,13 @@ 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); + 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); + } if (!proxy) goto error_alloc_export_buffer;