libs: window: wayland: rt event queue at destroy()
authorJagyum Koo <koojagyum@gmail.com>
Sun, 30 Oct 2016 01:43:49 +0000 (10:43 +0900)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 21 Apr 2017 14:01:46 +0000 (16:01 +0200)
The proxy object of wl_buffer for the last frame remains in the
wl_map. Even though we call wl_buffer_destroy() in
frame_release_callback(), the proxy object remains without being
removed, since proxy object is deleted when wayland server sees the
delete request and sends 'delete_id' event.

We need to call roundtrip before destroying event_queue so that the
proxy object is removed. Otherwise, it would be mess up as receiving
'delete_id' event from previous play, when playing in the next
va/wayland window with the same wl_display connection.

https://bugzilla.gnome.org/show_bug.cgi?id=773689

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
gst-libs/gst/vaapi/gstvaapiwindow_wayland.c

index dda423b..e4797b7 100644 (file)
@@ -313,10 +313,15 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window)
 {
   GstVaapiWindowWaylandPrivate *const priv =
       GST_VAAPI_WINDOW_WAYLAND_GET_PRIVATE (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);
 
+  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;