From 4d9ae8ebbafcbf34c826c3ee7b2adba3964fa534 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Mon, 27 Jul 2015 18:21:19 +1000 Subject: [PATCH] wayland: fail window open if the display is the correct type Errors out cleanly if a wayland compositor is not running --- gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c index 07beb3dd7f..592c03ca58 100644 --- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c @@ -382,9 +382,17 @@ gst_gl_window_wayland_egl_close (GstGLWindow * window) static gboolean gst_gl_window_wayland_egl_open (GstGLWindow * window, GError ** error) { - GstGLDisplayWayland *display = GST_GL_DISPLAY_WAYLAND (window->display); + GstGLDisplayWayland *display; GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window); + if (!GST_IS_GL_DISPLAY_WAYLAND (window->display)) { + g_set_error (error, GST_GL_WINDOW_ERROR, + GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE, + "Failed to retrieve Wayland display (wrong type?)"); + return FALSE; + } + display = GST_GL_DISPLAY_WAYLAND (window->display); + if (!display->display) { g_set_error (error, GST_GL_WINDOW_ERROR, GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,