Skip to content

Commit 78a6798

Browse files
committed
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.
1 parent 99d6d4c commit 78a6798

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

player/video.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,9 +955,11 @@ static void schedule_frame(struct MPContext *mpctx, struct vo_frame *frame)
955955
}
956956

957957
if (!mpctx->display_sync_active) {
958-
mpctx->speed_factor_a = 1.0;
959-
mpctx->speed_factor_v = 1.0;
960-
update_playback_speed(mpctx);
958+
if (mpctx->past_frames[1].num_vsyncs >= 0) {
959+
mpctx->speed_factor_a = 1.0;
960+
mpctx->speed_factor_v = 1.0;
961+
update_playback_speed(mpctx);
962+
}
961963

962964
update_av_diff(mpctx, mpctx->time_frame > 0 ?
963965
mpctx->time_frame * mpctx->video_speed : 0);

0 commit comments

Comments
 (0)