diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index 8c6fdd0e71..47192df466 100644 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -637,6 +637,7 @@ frame_redraw_callback (void *data, struct wl_callback *callback, uint32_t time) g_mutex_lock (&sink->render_lock); sink->redraw_pending = FALSE; + sink->window->callback = NULL; g_mutex_unlock (&sink->render_lock); wl_callback_destroy (callback); @@ -660,6 +661,7 @@ render_last_buffer (GstWaylandSink * sink, gboolean redraw) sink->redraw_pending = TRUE; callback = wl_surface_frame (surface); + sink->window->callback = callback; wl_callback_add_listener (callback, &frame_callback_listener, sink); if (G_UNLIKELY (sink->video_info_changed && !redraw)) { diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c index 0cf85aa625..3fdf0273bd 100644 --- a/ext/wayland/wlwindow.c +++ b/ext/wayland/wlwindow.c @@ -157,6 +157,9 @@ gst_wl_window_finalize (GObject * gobject) { GstWlWindow *self = GST_WL_WINDOW (gobject); + if (self->callback) + wl_callback_destroy (self->callback); + if (self->wl_shell_surface) wl_shell_surface_destroy (self->wl_shell_surface); @@ -197,6 +200,7 @@ gst_wl_window_new_internal (GstWlDisplay * display, GMutex * render_lock) window->render_lock = render_lock; g_cond_init (&window->configure_cond); + window->callback = NULL; window->area_surface = wl_compositor_create_surface (display->compositor); window->video_surface = wl_compositor_create_surface (display->compositor); diff --git a/ext/wayland/wlwindow.h b/ext/wayland/wlwindow.h index c3f0172166..cecbda6649 100644 --- a/ext/wayland/wlwindow.h +++ b/ext/wayland/wlwindow.h @@ -55,6 +55,7 @@ struct _GstWlWindow struct wl_shell_surface *wl_shell_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; + struct wl_callback *callback; gboolean configured; GCond configure_cond; GMutex configure_mutex;