From a5dcb74feeca4aeef2354ae1936b2fdd71492a6f Mon Sep 17 00:00:00 2001 From: llyyr Date: Thu, 23 Oct 2025 15:07:05 +0530 Subject: [PATCH 1/2] player/command: update speed filters for pitch-correction change too Fixes #16947 for both audio only files as well as for files with video which would only accidentally worked. See next commit --- player/command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player/command.c b/player/command.c index 67ad87c6e3841..a636297b7435e 100644 --- a/player/command.c +++ b/player/command.c @@ -8027,7 +8027,8 @@ void mp_option_run_callback(struct MPContext *mpctx, struct mp_option_callback * run_command_opts(mpctx); } - if (opt_ptr == &opts->playback_speed || opt_ptr == &opts->playback_pitch) { + if (opt_ptr == &opts->playback_speed || opt_ptr == &opts->playback_pitch || + opt_ptr == &opts->pitch_correction) { update_playback_speed(mpctx); mp_wakeup_core(mpctx); } From 9aeb539d2a9eddd9aaae15ac158ef421e5fb4837 Mon Sep 17 00:00:00 2001 From: llyyr Date: Thu, 23 Oct 2025 15:04:55 +0530 Subject: [PATCH 2/2] 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. --- player/video.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/player/video.c b/player/video.c index 048c3ca6ea85e..0e1ac290d2fe5 100644 --- a/player/video.c +++ b/player/video.c @@ -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);