diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-11-14 09:52:33 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-18 22:54:29 +0000 |
commit | 01b4b2064376d171472e2f4a937d92ff29d8d47b (patch) | |
tree | a6e058c85d0185751e8feab039ef60ec2f044d34 /player/video.c | |
parent | 6fce181a25b69d4c418693988b4dc1ab5476e068 (diff) | |
download | mpv-01b4b2064376d171472e2f4a937d92ff29d8d47b.tar.bz2 mpv-01b4b2064376d171472e2f4a937d92ff29d8d47b.tar.xz |
player/video: account for repeats in ideal_frame_vsync_duration
Frame repeats may occur to compensate for A/V diff. This commit ensures
a uniform distribution of vsync points based on the number of repeats.
Diffstat (limited to 'player/video.c')
-rw-r--r-- | player/video.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/player/video.c b/player/video.c index 4f2d103b98..85b9e75a09 100644 --- a/player/video.c +++ b/player/video.c @@ -924,6 +924,10 @@ static void handle_display_sync_frame(struct MPContext *mpctx, frame->num_vsyncs = num_vsyncs; frame->display_synced = true; + // Adjust frame virtual vsyncs by the repeat count + if (drop_repeat > 0) + frame->ideal_frame_vsync_duration /= drop_repeat; + mpctx->display_sync_active = true; // Try to avoid audio underruns that may occur if we update // the playback speed while in the STATUS_SYNCING state. |