diff options
author | Hyunjun Ko <zzoon@igalia.com> | 2017-04-19 10:37:19 +0900 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-04-21 16:01:47 +0200 |
commit | ca314a25ccf81c9740d147c6b20de4c24b354301 (patch) | |
tree | 28bac5371c73e1e5111294ff1ac9adae7899e0ec | |
parent | 896a836f1dcd52c08d6ebcd5045d47036dce5854 (diff) | |
download | gstreamer-ca314a25ccf81c9740d147c6b20de4c24b354301.tar.gz |
libs: window: wayland: null buffer at destroy()
Fix leakage of the last wl buffer.
VAAPI wayland sink needs to send a null buffer while destruction,
it assures that all the wl buffers are released. Otherwise, the last
buffer's callback might be not called, which leads to leak of
GstVaapiDisplay.
This was inspired by gstwaylandsink.
https://bugzilla.gnome.org/show_bug.cgi?id=774029
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiwindow_wayland.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c index e4797b7c21..ace2cffb04 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c @@ -319,6 +319,15 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window) /* Wait for the last frame to complete redraw */ gst_vaapi_window_wayland_sync (window); + /* Make sure that the last wl buffer's callback could be called */ + GST_VAAPI_OBJECT_LOCK_DISPLAY (window); + if (priv->surface) { + wl_surface_attach (priv->surface, NULL, 0, 0); + wl_surface_commit (priv->surface); + wl_display_flush (wl_display); + } + GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window); + if (priv->event_queue) wl_display_roundtrip_queue (wl_display, priv->event_queue); |