From 1ab9119817d43568b0748238a64ae0772667d229 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 24 Nov 2021 23:37:43 -0600 Subject: wayland: increase the vblank waiting time This commit sucks bad, but everything else is worse is other ways. Basically, the current vblank waiting time in the vo_wayland_wait_frame function (calculated very carefully using presentation statistics) is randomly too short. Some compositors are quite variable when they actually return callback so our timeout expires too quickly and throws everything off. The fix? Add an arbitrary 5% to the vblank value and pray that nothing gets off that much. Why did they have to make swapinterval 1/fifo mode indefinitely block? Fixes #9504. --- video/out/wayland_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 975b3eaba0..0e85338b89 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1986,6 +1986,8 @@ void vo_wayland_wait_frame(struct vo_wayland_state *wl) if (vblank_time <= 0) vblank_time = 1e6 / 60; + // Completely arbitrary amount of additional time to wait. + vblank_time += 0.05 * vblank_time; int64_t finish_time = mp_time_us() + vblank_time; while (wl->frame_wait && finish_time > mp_time_us()) { -- cgit v1.2.3