player/video: only set a/v speed factor to 1 when exiting display-sync

Previously this would be called on every frame presented, this only
needs to be called if display sync was active for the last frame but
isn't active anymore.

This hid the bug mentioned in #16947 if VO was active.
This commit is contained in:
llyyr
2025-10-23 15:04:55 +05:30
committed by Dudemanguy
parent ddd0fc0beb
commit b6c35b55a0

View File

@@ -955,9 +955,11 @@ static void schedule_frame(struct MPContext *mpctx, struct vo_frame *frame)
}
if (!mpctx->display_sync_active) {
mpctx->speed_factor_a = 1.0;
mpctx->speed_factor_v = 1.0;
update_playback_speed(mpctx);
if (mpctx->num_past_frames > 1 && mpctx->past_frames[1].num_vsyncs >= 0) {
mpctx->speed_factor_a = 1.0;
mpctx->speed_factor_v = 1.0;
update_playback_speed(mpctx);
}
update_av_diff(mpctx, mpctx->time_frame > 0 ?
mpctx->time_frame * mpctx->video_speed : 0);