summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-10-04 11:05:00 -0500
committerDudemanguy <random342@airmail.cc>2022-10-06 18:08:51 +0000
commitd2a0791fe83d8382e06232e72549cab4e4c66130 (patch)
treeae253cf7a653c5940f99649475cb5b4f10f9e59c /video/out/wayland_common.h
parent7f5541fc3c440a4aa5fdec2899c02d1caf7fb227 (diff)
downloadmpv-d2a0791fe83d8382e06232e72549cab4e4c66130.tar.bz2
mpv-d2a0791fe83d8382e06232e72549cab4e4c66130.tar.xz
wayland: correctly handle non-CLOCK_MONOTONIC clocks
The wayland presentation time code currently always assumes that only CLOCK_MONOTONIC can be used. There is a naive attempt to ignore clocks other than CLOCK_MONOTONIC, but the logic is actually totally wrong and the timestamps would be used anyway. Fix this by checking a use_present bool (similar to use_present in xorg) which is set to true if we receive a valid clock in the clockid event. Additionally, allow CLOCK_MONOTONIC_RAW as a valid clockid. In practice, it should be the same as CLOCK_MONOTONIC for us (ntp/adjustime difference wouldn't matter). Since this is a linux-specific clock, add a define for it if it is not found.
Diffstat (limited to 'video/out/wayland_common.h')
-rw-r--r--video/out/wayland_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
index 365ae42dab..77699a3dd6 100644
--- a/video/out/wayland_common.h
+++ b/video/out/wayland_common.h
@@ -92,6 +92,7 @@ struct vo_wayland_state {
struct wp_presentation_feedback *feedback;
struct mp_present *present;
int64_t refresh_interval;
+ bool use_present;
/* xdg-decoration */
struct zxdg_decoration_manager_v1 *xdg_decoration_manager;