From 7023c383b22a9619840b88175a8c272f2f9d4414 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 27 Nov 2015 22:04:44 +0100 Subject: vo: change vo_frame field units This was just converting back and forth between int64_t/microseconds and double/seconds. Remove this stupidity. The pts/duration fields are still in microseconds, but they have no meaning in the display-sync case (also drop printing the pts field from opengl/video.c - it's always 0). --- video/out/opengl/video.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 4c62efe3be..7f0bb22b8f 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2088,7 +2088,7 @@ static void gl_video_interpolate_frame(struct gl_video *p, struct vo_frame *t, double pts_now = p->surfaces[surface_now].pts, pts_nxt = p->surfaces[surface_nxt].pts; - double mix = (t->vsync_offset / 1e6) / (pts_nxt - pts_now); + double mix = t->vsync_offset / (pts_nxt - pts_now); // The scaler code always wants the fcoord to be between 0 and 1, // so we try to adjust by using the previous set of N frames instead // (which requires some extra checking to make sure it's valid) @@ -2107,7 +2107,7 @@ static void gl_video_interpolate_frame(struct gl_video *p, struct vo_frame *t, // Blend the frames together if (oversample) { - double vsync_dist = t->vsync_interval / 1e6 / (pts_nxt - pts_now), + double vsync_dist = t->vsync_interval / (pts_nxt - pts_now), threshold = tscale->conf.kernel.params[0]; threshold = isnan(threshold) ? 0.0 : threshold; mix = (1 - mix) / vsync_dist; @@ -2130,8 +2130,7 @@ static void gl_video_interpolate_frame(struct gl_video *p, struct vo_frame *t, } MP_STATS(p, "frame-mix"); - MP_DBG(p, "inter frame pts: %lld, vsync: %lld, mix: %f\n", - (long long)t->pts, (long long)t->vsync_interval, mix); + MP_DBG(p, "inter frame vsync: %f, mix: %f\n", t->vsync_interval, mix); p->is_interpolated = true; } pass_draw_to_screen(p, fbo); -- cgit v1.2.3