0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
Kacper Michajłow 2023-11-14 09:52:33 +01:00 committed by Dudemanguy
parent 6fce181a25
commit 01b4b20643

View File

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