summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c')
-rw-r--r--gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
index f2d7ceb4e..621e4dba3 100644
--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
+++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
@@ -614,8 +614,11 @@ gst_gl_window_wayland_egl_set_window_handle (GstGLWindow * window,
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
struct wl_surface *surface = (struct wl_surface *) handle;
- /* already set the NULL handle */
- if (surface == NULL && window_egl->window.foreign_surface == NULL)
+ /* Don't unparent if the window handle haven't changed or both were %NULL.
+ * We have to do that, since GstGLContextEGL will not recreate its
+ * EGLNativeWindowSurface, which will lead to crash with some Mesa driver
+ * version, or errors otherwise. */
+ if (window_egl->window.foreign_surface == surface)
return;
/* unparent */