summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/vo.c7
-rw-r--r--video/out/vo.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index f047704c05..f920e12da8 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -589,7 +589,12 @@ static bool render_frame(struct vo *vo)
else
vo->driver->flip_page(vo);
- in->last_flip = mp_time_us();
+ in->last_flip = -1;
+
+ vo->driver->control(vo, VOCTRL_GET_RECENT_FLIP_TIME, &in->last_flip);
+
+ if (in->last_flip < 0)
+ in->last_flip = mp_time_us();
long phase = in->last_flip % in->vsync_interval;
MP_DBG(vo, "phase: %ld\n", phase);
diff --git a/video/out/vo.h b/video/out/vo.h
index 93094117a6..a384ed5ad6 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -86,6 +86,7 @@ enum mp_voctrl {
VOCTRL_GET_ICC_PROFILE_PATH, // char**
VOCTRL_GET_DISPLAY_FPS, // double*
+ VOCTRL_GET_RECENT_FLIP_TIME, // int64_t* (using mp_time_us())
VOCTRL_GET_PREF_DEINT, // int*
};