1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-04 14:11:53 +00:00

vo_wayand: save the flip time in the frame handler

This value is more accurate than the default value.
This commit is contained in:
Alexander Preisinger 2014-08-20 16:35:06 +02:00
parent 1cb15316b0
commit 3bf83f7642

View File

@ -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);