From f3f49de91835b256108a4cc9b242f3880c464889 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 24 Aug 2020 11:11:39 -0500 Subject: 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. --- video/out/wayland_common.c | 1 + 1 file changed, 1 insertion(+) (limited to 'video/out/wayland_common.c') 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; -- cgit v1.2.3