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.
This commit is contained in:
Dudemanguy 2020-08-24 11:11:39 -05:00
parent 74e62ed2d1
commit f3f49de918
1 changed files with 1 additions and 0 deletions

View File

@ -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;