summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-09 17:46:35 +0100
committerwm4 <wm4@nowhere>2014-12-09 17:59:04 +0100
commitd38bc531cc7ce9c90b74145e2be2e24cb48e501a (patch)
tree0c53c6e9199794c5c5f3e1509abae1750a77759e /video/out/vo_vdpau.c
parent349d19dda9f7fe486c9521c04023528c7aa71998 (diff)
downloadmpv-d38bc531cc7ce9c90b74145e2be2e24cb48e501a.tar.bz2
mpv-d38bc531cc7ce9c90b74145e2be2e24cb48e501a.tar.xz
vo: include normal render-ahead time in flip_queue_offset
A small refactor; shouldn't change any behavior. Do this so immediate display can be achieved.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index aa2cd910a0..c1b63345f1 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -99,7 +99,7 @@ struct vdpctx {
int chroma_deint;
int flip_offset_window;
int flip_offset_fs;
- int flip_offset_ms;
+ int64_t flip_offset_us;
bool flip;
VdpRect src_rect_vid;
@@ -258,11 +258,12 @@ static void resize(struct vo *vo)
vc->src_rect_vid.y0 = vc->flip ? src_rect.y1 : src_rect.y0;
vc->src_rect_vid.y1 = vc->flip ? src_rect.y0 : src_rect.y1;
- vc->flip_offset_ms = vo->opts->fullscreen ?
- vc->flip_offset_fs :
- vc->flip_offset_window;
+ vc->flip_offset_us = vo->opts->fullscreen ?
+ 1000LL * vc->flip_offset_fs :
+ 1000LL * vc->flip_offset_window;
+ vc->flip_offset_us += VO_DEFAULT_FLIP_QUEUE_OFFSET;
- vo_set_flip_queue_offset(vo, vc->flip_offset_ms * 1000);
+ vo_set_flip_queue_offset(vo, vc->flip_offset_us);
if (vc->output_surface_width < vo->dwidth
|| vc->output_surface_height < vo->dheight) {
@@ -752,11 +753,11 @@ static int flip_page_timed(struct vo *vo, int64_t pts_us, int duration)
/* This should normally never happen.
* - The last queued frame can't have a PTS that goes more than 50ms in the
* future. This is guaranteed by vo.c, which currently actually queues
- * ahead by roughly 50ms, plus the flip queue offset. Just to be sure
+ * ahead by roughly the flip queue offset. Just to be sure
* give some additional room by doubling the time.
* - The last vsync can never be in the future.
*/
- int64_t max_pts_ahead = (vc->flip_offset_ms + 50) * 1000 * 1000 * 2;
+ int64_t max_pts_ahead = vc->flip_offset_us * 1000 * 2;
if (vc->last_queue_time > now + max_pts_ahead ||
vc->recent_vsync_time > now)
{