player/video: fix calculation of ideal_frame_vsync_duration

During move of this code from vo_gpu_next.c to video.c someone(TM) tried
to be smart and simplify the expression. The num_vsync includes error
compensation which can cause it to display +-1 vsync at the same rate.
We explicitly don't want to include this in "ideal" parameters.

Also num_vsyncs was already rounded so we produced off timings in
general.

Revert back to proper way of translating the time.

Fixes: 5e5a325
This commit is contained in:
Kacper Michajłow
2023-11-12 11:59:10 +01:00
committed by Dudemanguy
parent 8b3075c9be
commit 08c12a28b3

View File

@@ -920,7 +920,7 @@ static void handle_display_sync_frame(struct MPContext *mpctx,
frame->vsync_offset = -prev_error;
frame->ideal_frame_duration = frame_duration;
frame->ideal_frame_vsync = (-prev_error / frame_duration) * approx_duration;
frame->ideal_frame_vsync_duration = approx_duration / num_vsyncs;
frame->ideal_frame_vsync_duration = (vsync / frame_duration) * approx_duration;
frame->num_vsyncs = num_vsyncs;
frame->display_synced = true;