diff options
author | wm4 <wm4@nowhere> | 2014-08-18 23:01:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-18 23:04:31 +0200 |
commit | 3d968fc620da8781b06044af2ec38ea2a9f95d41 (patch) | |
tree | 8566bd37de1378d17fbffbedd03e3820c9c0bd99 /video/out/vo.c | |
parent | cd2e4db8a5cae7362065b223be129bb9258eeedd (diff) | |
download | mpv-3d968fc620da8781b06044af2ec38ea2a9f95d41.tar.bz2 mpv-3d968fc620da8781b06044af2ec38ea2a9f95d41.tar.xz |
video: add VOCTRL_GET_RECENT_FLIP_TIME
This could be used by VO implementations to report a recent vsync time
to the generic VO code, which in turn will use it and the display FPS
to estimate at which point in time the next vsync will happen.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r-- | video/out/vo.c | 7 |
1 files changed, 6 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); |