From a1189301c9816936b070150691114dec2a053104 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 20 Nov 2013 15:10:17 +0100 Subject: [PATCH] libs: fix GstVaapiSurfaceProxy destroy notify call site. The user-defined destroy notify function is meant to be called only when the surface proxy was fully released, i.e. once it actually released the VA surface back to the underlying pool. --- gst-libs/gst/vaapi/gstvaapisurfaceproxy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c index f698103..f9e488a 100644 --- a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c +++ b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c @@ -36,9 +36,6 @@ static void gst_vaapi_surface_proxy_finalize(GstVaapiSurfaceProxy *proxy) { - if (proxy->destroy_func) - proxy->destroy_func(proxy->destroy_data); - if (proxy->surface) { if (proxy->pool) gst_vaapi_video_pool_put_object(proxy->pool, proxy->surface); @@ -46,6 +43,10 @@ gst_vaapi_surface_proxy_finalize(GstVaapiSurfaceProxy *proxy) proxy->surface = NULL; } gst_vaapi_video_pool_replace(&proxy->pool, NULL); + + /* Notify the user function that the object is now destroyed */ + if (proxy->destroy_func) + proxy->destroy_func(proxy->destroy_data); } static inline const GstVaapiMiniObjectClass * -- 2.7.4