mirror of https://github.com/mpv-player/mpv
gl_wayland: Wait for frame callbacks
Keep glSwapInterval(0) on to avoid blocking on gl calls, but wait for frame callbacks so we play nice with compositor.
This commit is contained in:
parent
e05dc7bfb7
commit
d29e699491
|
@ -210,6 +210,11 @@ static void swapGlBuffers_wayland(MPGLContext *ctx)
|
|||
{
|
||||
struct vo_wayland_state *wl = ctx->vo->wayland;
|
||||
|
||||
if (!wl->frame.callback)
|
||||
vo_wayland_request_frame(ctx->vo, NULL, NULL);
|
||||
|
||||
if (!vo_wayland_wait_frame(ctx->vo))
|
||||
MP_DBG(wl, "discarding frame callback\n");
|
||||
|
||||
eglSwapBuffers(wl->egl_context.egl.dpy, wl->egl_context.egl_surface);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue