diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-08-20 16:35:06 +0200 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-08-20 16:35:06 +0200 |
commit | 3bf83f76429c75a6104cf374e581116923df74cc (patch) | |
tree | 6780c0275b59ddab934a961a073f1f975ae825cb /video/out | |
parent | 1cb15316b09fa9091d25f06603570475f5b18921 (diff) | |
download | mpv-3bf83f76429c75a6104cf374e581116923df74cc.tar.bz2 mpv-3bf83f76429c75a6104cf374e581116923df74cc.tar.xz |
vo_wayand: save the flip time in the frame handler
This value is more accurate than the default value.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_wayland.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |