From 9dead2b932e13be6e25cdff20294fbb9e616d69c Mon Sep 17 00:00:00 2001 From: Dudemanguy911 Date: Sun, 20 Oct 2019 12:46:42 -0500 Subject: wayland: fix presentation time There's 2 stupid things here that need to be fixed. First of all, vulkan wasn't actually using presentation time because somehow the get_vsync function in context.c disappeared. Secondly, if the mpv window was hidden it was updating the ust time based on the refresh_usec but really it should simply just not feed any information to the vsync info structure. So this adds some logic to assume whether or not a window is hidden. --- video/out/vulkan/context.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'video/out/vulkan/context.c') diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index ea546519ec..3a8f58e4c4 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -246,9 +246,18 @@ static void swap_buffers(struct ra_swapchain *sw) p->params.swap_buffers(sw->ctx); } +static void get_vsync(struct ra_swapchain *sw, + struct vo_vsync_info *info) +{ + struct priv *p = sw->priv; + if (p->params.get_vsync) + p->params.get_vsync(sw->ctx, info); +} + static const struct ra_swapchain_fns vulkan_swapchain = { .color_depth = color_depth, .start_frame = start_frame, .submit_frame = submit_frame, .swap_buffers = swap_buffers, + .get_vsync = get_vsync, }; -- cgit v1.2.3