From 3bf83f76429c75a6104cf374e581116923df74cc Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Wed, 20 Aug 2014 16:35:06 +0200 Subject: vo_wayand: save the flip time in the frame handler This value is more accurate than the default value. --- video/out/vo_wayland.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index cde13bcded..92d7d56f68 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -42,6 +42,8 @@ #include "common/msg.h" #include "input/input.h" +#include "osdep/timer.h" + #include "wayland_common.h" #include "wayland-version.h" @@ -161,6 +163,8 @@ struct priv { // this id tells us if the subtitle part has changed or not int bitmap_pos_id[MAX_OSD_PARTS]; + int64_t recent_flip_time; // last frame event + // options int enable_alpha; int use_rgb565; @@ -621,6 +625,7 @@ static void frame_handle_redraw(void *data, p->redraw_callback = NULL; } + p->recent_flip_time = mp_time_us(); } static const struct wl_callback_listener frame_listener = { @@ -907,6 +912,11 @@ static int control(struct vo *vo, uint32_t request, void *data) args->out_image = get_screenshot(p); return true; } + case VOCTRL_GET_RECENT_FLIP_TIME: + { + *(int64_t*) data = p->recent_flip_time; + return VO_TRUE; + } } int events = 0; int r = vo_wayland_control(vo, &events, request, data); -- cgit v1.2.3