From 58f3009b807e644e96f0ba09ce50dafc7ddf741e Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:57:20 -0400 Subject: [PATCH] playloop: move run_command_opts to command_event for playback-restart --- player/command.c | 4 +++- player/playloop.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/player/command.c b/player/command.c index b41f13b874..a2b2bcf233 100644 --- a/player/command.c +++ b/player/command.c @@ -7232,8 +7232,10 @@ static void command_event(struct MPContext *mpctx, int event, void *arg) ctx->marked_permanent = false; } - if (event == MPV_EVENT_PLAYBACK_RESTART) + if (event == MPV_EVENT_PLAYBACK_RESTART) { ctx->last_seek_time = mp_time_sec(); + run_command_opts(mpctx); + } if (event == MPV_EVENT_IDLE) run_command_opts(mpctx); diff --git a/player/playloop.c b/player/playloop.c index c6c4b0c7b4..ef73bdbbb8 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -1149,7 +1149,6 @@ static void handle_playback_restart(struct MPContext *mpctx) mpctx->hrseek_active = false; mpctx->restart_complete = true; mpctx->current_seek = (struct seek_params){0}; - run_command_opts(mpctx); handle_playback_time(mpctx); mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL); update_core_idle_state(mpctx);