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.
This commit is contained in:
Dudemanguy 2022-12-31 21:06:38 -06:00
parent d1d2370d07
commit 24e2251b73
1 changed files with 1 additions and 4 deletions

View File

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