diff options
author | Dudemanguy <random342@airmail.cc> | 2022-10-04 11:05:00 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-10-06 18:08:51 +0000 |
commit | d2a0791fe83d8382e06232e72549cab4e4c66130 (patch) | |
tree | ae253cf7a653c5940f99649475cb5b4f10f9e59c /video/out/vulkan/context_wayland.c | |
parent | 7f5541fc3c440a4aa5fdec2899c02d1caf7fb227 (diff) | |
download | mpv-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/vulkan/context_wayland.c')
-rw-r--r-- | video/out/vulkan/context_wayland.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/vulkan/context_wayland.c b/video/out/vulkan/context_wayland.c index 7bc26ab1c6..fe20336a9e 100644 --- a/video/out/vulkan/context_wayland.c +++ b/video/out/vulkan/context_wayland.c @@ -39,14 +39,14 @@ static void wayland_vk_swap_buffers(struct ra_ctx *ctx) if (!wl->opts->disable_vsync) vo_wayland_wait_frame(wl); - if (wl->presentation) + if (wl->use_present) present_sync_swap(wl->present); } static void wayland_vk_get_vsync(struct ra_ctx *ctx, struct vo_vsync_info *info) { struct vo_wayland_state *wl = ctx->vo->wl; - if (wl->presentation) + if (wl->use_present) present_sync_get_info(wl->present, info); } |