mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
committed by
Dudemanguy
parent
8b3075c9be
commit
08c12a28b3
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user