From 318e9801f2ac649ecc6c7d4fb83c7c46fa5b581d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 28 Nov 2015 15:45:35 +0100 Subject: vo_opengl: fix interpolation with display-sync At least I hope so. Deriving the duration from the pts was not really correct. It doesn't include speed adjustments, and becomes completely wrong of the user e.g. changes the playback speed by a huge amount. Pass through the accurate duration value by adding a new vo_frame field. The value for vsync_offset was not correct either. We don't need the error for the next frame, but the error for the current one. This wasn't noticed because it makes no difference in symmetric cases, like 24 fps on 60 Hz. I'm still not entirely confident in the correctness of this, but it sure is an improvement. Also, remove the MP_STATS() calls - they're not really useful to debug anything anymore. --- player/video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 6d04685953..91899dc451 100644 --- a/player/video.c +++ b/player/video.c @@ -1046,7 +1046,8 @@ static void handle_display_sync_frame(struct MPContext *mpctx, mpctx->time_frame = time_left; frame->vsync_interval = vsync; - frame->vsync_offset = mpctx->display_sync_error; + frame->vsync_offset = -prev_error; + frame->ideal_frame_duration = frame_duration; frame->num_vsyncs = num_vsyncs; frame->display_synced = true; -- cgit v1.2.3