summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2020-08-24 11:11:39 -0500
committerDudemanguy <random342@airmail.cc>2020-08-24 11:11:39 -0500
commitf3f49de91835b256108a4cc9b242f3880c464889 (patch)
tree3c5ff0de6f255705087a7d59820896a342bc5c90 /video/out/wayland_common.c
parent74e62ed2d1e2058f6dbc9e8b9f759c20493e25bf (diff)
downloadmpv-f3f49de91835b256108a4cc9b242f3880c464889.tar.bz2
mpv-f3f49de91835b256108a4cc9b242f3880c464889.tar.xz
wayland: always update sbc for presentation time
Oversight in b0f0be7. The user_sbc value would update but not last_sbc if no presentation events were received. This would result in an incorrect sbc_passed value (in practice, this should always be 1 since, as far I know, all wayland compositors are currently only capable of double buffering). When bring the window back into view, it would result in a single frame of very high vsync jitter. Although in most cases it was imperceptible, rarely I was able to completely break playback (i.e. constant mistimed/dropped frames). Fix this by simply incrementing last_sbc by 1 if the window is hidden. The buffer swap call did still occur. The user just didn't see it.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index d795f42998..a79c8aa8ca 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1621,6 +1621,7 @@ void wayland_sync_swap(struct vo_wayland_state *wl)
// This will happen if the window is obscured/hidden in some way. Set
// these values to -1 to disable presentation feedback in mpv's core.
if (wl->sync[index].ust == wl->last_ust) {
+ wl->last_sbc += 1;
wl->last_skipped_vsyncs = -1;
wl->vsync_duration = -1;
wl->last_queue_display_time = -1;