summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2021-11-24 23:37:43 -0600
committerDudemanguy <random342@airmail.cc>2021-11-25 17:20:26 +0000
commit1ab9119817d43568b0748238a64ae0772667d229 (patch)
treeb8411bd10f364650e49adc81c44c606c4942cd88
parent55b085707adcd3701ed5f8b6b9953ed90ecdb59a (diff)
downloadmpv-1ab9119817d43568b0748238a64ae0772667d229.tar.bz2
mpv-1ab9119817d43568b0748238a64ae0772667d229.tar.xz
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.
-rw-r--r--video/out/wayland_common.c2
1 files changed, 2 insertions, 0 deletions
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()) {