From 3b314ba93e61bad3d8decbe45bcb12717b595a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 21 Apr 2017 14:07:44 +0200 Subject: [PATCH] libs: window: wayland: don't sync at destroy() Don't call gst_vaapi_window_wayland_sync() when destroying the wayland window instance, since it might lead to a lock at gst_poll_wait() when more than one instances of vaapisink are rendering in the same pipeline, this is because they share the same window. Since now all the frames are freed we don't need to freed the private last_frame, since its address is invalid now. https://bugzilla.gnome.org/show_bug.cgi?id=780442 Signed-off-by: Hyunjun Ko --- gst-libs/gst/vaapi/gstvaapiwindow_wayland.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c index ace2cffb04..1cdf6d22c0 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c @@ -316,9 +316,6 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window) struct wl_display *const wl_display = GST_VAAPI_OBJECT_NATIVE_DISPLAY (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) { @@ -328,14 +325,11 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window) } GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window); + gst_poll_set_flushing (priv->poll, TRUE); + if (priv->event_queue) wl_display_roundtrip_queue (wl_display, priv->event_queue); - if (priv->last_frame) { - frame_state_free (priv->last_frame); - priv->last_frame = NULL; - } - if (priv->shell_surface) { wl_shell_surface_destroy (priv->shell_surface); priv->shell_surface = NULL;