summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-12-31 21:06:38 -0600
committerDudemanguy <random342@airmail.cc>2023-01-03 20:45:39 +0000
commit24e2251b734da0e50ecc4bba773b6d812103b31d (patch)
treedc13bc32982a60249ca7d4614bc73af4cd02d978 /video/out/wayland_common.c
parentd1d2370d073e9b70a181696e57075545b4802517 (diff)
downloadmpv-24e2251b734da0e50ecc4bba773b6d812103b31d.tar.bz2
mpv-24e2251b734da0e50ecc4bba773b6d812103b31d.tar.xz
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.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c5
1 files changed, 1 insertions, 4 deletions
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);
}