summaryrefslogtreecommitdiff
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2017-04-25 16:23:08 +0900
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-04-25 11:24:38 +0200
commit2d7c7630c9e64294bace52e87122d37bbef4e2d8 (patch)
treeca49d34387dd5684ff8797cea43454b754a63bdd /gst-libs/gst
parent307148dfc801d2c2c3eada4e041bdb81f24783b6 (diff)
libs: windows: wayland: fix leak if failure of sync
Sometimes gst_vaapi_window_wayland_sync returns FALSE when poll returns EBUSY during destruction. In this case, if GstVaapiWindow is using vpp, leak of vpp surface happens. This surface is not attached to anything at this moment, so we should release it manually. https://bugzilla.gnome.org/show_bug.cgi?id=781695
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiwindow_wayland.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
index 80f0f5e6..45934aa7 100644
--- a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
+++ b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
@@ -480,6 +480,9 @@ gst_vaapi_window_wayland_render (GstVaapiWindow * window,
/* Wait for the previous frame to complete redraw */
if (!gst_vaapi_window_wayland_sync (window)) {
+ /* Release vpp surface if exists */
+ if (priv->need_vpp && window->has_vpp)
+ gst_vaapi_video_pool_put_object (window->surface_pool, surface);
wl_buffer_destroy (buffer);
return !priv->sync_failed;
}