playloop: move run_command_opts to command_event for playback-restart

This commit is contained in:
nanahi 2024-07-17 09:57:20 -04:00 committed by Dudemanguy
parent 503a896d1a
commit 58f3009b80
2 changed files with 3 additions and 2 deletions

View File

@ -7232,8 +7232,10 @@ static void command_event(struct MPContext *mpctx, int event, void *arg)
ctx->marked_permanent = false; ctx->marked_permanent = false;
} }
if (event == MPV_EVENT_PLAYBACK_RESTART) if (event == MPV_EVENT_PLAYBACK_RESTART) {
ctx->last_seek_time = mp_time_sec(); ctx->last_seek_time = mp_time_sec();
run_command_opts(mpctx);
}
if (event == MPV_EVENT_IDLE) if (event == MPV_EVENT_IDLE)
run_command_opts(mpctx); run_command_opts(mpctx);

View File

@ -1149,7 +1149,6 @@ static void handle_playback_restart(struct MPContext *mpctx)
mpctx->hrseek_active = false; mpctx->hrseek_active = false;
mpctx->restart_complete = true; mpctx->restart_complete = true;
mpctx->current_seek = (struct seek_params){0}; mpctx->current_seek = (struct seek_params){0};
run_command_opts(mpctx);
handle_playback_time(mpctx); handle_playback_time(mpctx);
mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL); mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL);
update_core_idle_state(mpctx); update_core_idle_state(mpctx);