summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2015-08-19 22:42:40 +0300
committerwm4 <wm4@nowhere>2015-08-21 00:01:01 +0200
commitd29e699491b64e659df1941b2f3f87c931f23789 (patch)
tree3012e92520df08f1967c5e3aa9bfe01caf1fe94a
parente05dc7bfb7c8a2d0c461cb1d60386f067bd01061 (diff)
downloadmpv-d29e699491b64e659df1941b2f3f87c931f23789.tar.bz2
mpv-d29e699491b64e659df1941b2f3f87c931f23789.tar.xz
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.
-rw-r--r--video/out/gl_wayland.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/gl_wayland.c b/video/out/gl_wayland.c
index 2a565a36d6..a6a23bd180 100644
--- a/video/out/gl_wayland.c
+++ b/video/out/gl_wayland.c
@@ -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);
}