From 24e2251b734da0e50ecc4bba773b6d812103b31d Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 31 Dec 2022 21:06:38 -0600 Subject: wayland: consistently employ use_present We have a use_present bool that keeps track of whether or not to use presentation time. However, the creation of the feedback listener actually wasn't checking this and was instead checking for the existence of wl->presentation. There's no point in always creating the listener and feedback if mpv isn't actually going to use it. Just change it to use_present instead. --- video/out/wayland_common.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'video/out') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 04db490c5e..43e8967003 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1030,9 +1030,6 @@ static void feedback_presented(void *data, struct wp_presentation_feedback *fbac wl->feedback = NULL; } - if (!wl->use_present) - return; - wl->refresh_interval = (int64_t)refresh_nsec / 1000; // Very similar to oml_sync_control, in this case we assume that every @@ -1079,7 +1076,7 @@ static void frame_callback(void *data, struct wl_callback *callback, uint32_t ti wl->frame_callback = wl_surface_frame(wl->surface); wl_callback_add_listener(wl->frame_callback, &frame_listener, wl); - if (wl->presentation) { + if (wl->use_present) { wl->feedback = wp_presentation_feedback(wl->presentation, wl->surface); wp_presentation_feedback_add_listener(wl->feedback, &feedback_listener, wl); } -- cgit v1.2.3