gl/x11: check whether the display is x11 before using it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8808>
This commit is contained in:
Elliot Chen 2025-04-22 17:31:59 +09:00 committed by GStreamer Marge Bot
parent 834b702e66
commit c3d8347c81

View File

@ -149,9 +149,8 @@ static gboolean
gst_gl_window_x11_open (GstGLWindow * window, GError ** error)
{
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
GstGLDisplayX11 *display_x11 = (GstGLDisplayX11 *) window->display;
window_x11->device = display_x11->display;
window_x11->device = (Display *) gst_gl_display_get_handle (window->display);
// window_x11->device = XOpenDisplay (display_x11->name);
if (window_x11->device == NULL) {
g_set_error (error, GST_GL_WINDOW_ERROR,