diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-11-12 11:59:10 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-12 20:22:26 +0000 |
commit | 08c12a28b3cbc3a081ec88b9eae14eddb1906d9e (patch) | |
tree | 12af61f66708fd1844c924972c7ffb51aeebec74 /player/video.c | |
parent | 8b3075c9be36a256ac7e627081ae8c4ecf6ed685 (diff) | |
download | mpv-08c12a28b3cbc3a081ec88b9eae14eddb1906d9e.tar.bz2 mpv-08c12a28b3cbc3a081ec88b9eae14eddb1906d9e.tar.xz |
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
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c index 879cd52497..4f2d103b98 100644 --- a/player/video.c +++ b/player/video.c @@ -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; |