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.
This commit is contained in:
wm4
2015-11-28 15:45:35 +01:00
parent ea1caa474a
commit 318e9801f2
3 changed files with 11 additions and 13 deletions

View File

@@ -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;