diff options
-rw-r--r-- | video/out/opengl/context_wayland.c | 8 | ||||
-rw-r--r-- | video/out/opengl/context_x11egl.c | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index b402ca9055..e019f5fc8e 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -136,8 +136,12 @@ static void egl_create_window(struct ra_ctx *ctx) p->egl_window = wl_egl_window_create(wl->surface, mp_rect_w(wl->geometry), mp_rect_h(wl->geometry)); - p->egl_surface = eglCreateWindowSurface(p->egl_display, p->egl_config, - p->egl_window, NULL); + p->egl_surface = mpegl_create_window_surface( + p->egl_display, p->egl_config, p->egl_window); + if (p->egl_surface == EGL_NO_SURFACE) { + p->egl_surface = eglCreateWindowSurface( + p->egl_display, p->egl_config, p->egl_window, NULL); + } eglMakeCurrent(p->egl_display, p->egl_surface, p->egl_surface, p->egl_context); diff --git a/video/out/opengl/context_x11egl.c b/video/out/opengl/context_x11egl.c index 321df4039d..f1596bcee4 100644 --- a/video/out/opengl/context_x11egl.c +++ b/video/out/opengl/context_x11egl.c @@ -148,9 +148,12 @@ static bool mpegl_init(struct ra_ctx *ctx) XFree(vi); - p->egl_surface = eglCreateWindowSurface(p->egl_display, config, - (EGLNativeWindowType)vo->x11->window, NULL); - + p->egl_surface = mpegl_create_window_surface( + p->egl_display, config, &vo->x11->window); + if (p->egl_surface == EGL_NO_SURFACE) { + p->egl_surface = eglCreateWindowSurface( + p->egl_display, config, (EGLNativeWindowType)vo->x11->window, NULL); + } if (p->egl_surface == EGL_NO_SURFACE) { MP_FATAL(ctx, "Could not create EGL surface!\n"); goto uninit; |