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 <zzoon@igalia.com>
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-04-21 14:07:44 +02:00
parent ca314a25cc
commit 3b314ba93e

View file

@ -316,9 +316,6 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window)
struct wl_display *const wl_display = struct wl_display *const wl_display =
GST_VAAPI_OBJECT_NATIVE_DISPLAY (window); 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 */ /* Make sure that the last wl buffer's callback could be called */
GST_VAAPI_OBJECT_LOCK_DISPLAY (window); GST_VAAPI_OBJECT_LOCK_DISPLAY (window);
if (priv->surface) { if (priv->surface) {
@ -328,14 +325,11 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window)
} }
GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window); GST_VAAPI_OBJECT_UNLOCK_DISPLAY (window);
gst_poll_set_flushing (priv->poll, TRUE);
if (priv->event_queue) if (priv->event_queue)
wl_display_roundtrip_queue (wl_display, 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) { if (priv->shell_surface) {
wl_shell_surface_destroy (priv->shell_surface); wl_shell_surface_destroy (priv->shell_surface);
priv->shell_surface = NULL; priv->shell_surface = NULL;