mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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.
This commit is contained in:
parent
f9ee8703cf
commit
a1189301c9
1 changed files with 4 additions and 3 deletions
|
@ -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 *
|
||||
|
|
Loading…
Reference in a new issue