From 503a896d1ac0a5ab35d6db906d6ff452ba03667d Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Wed, 17 Jul 2024 06:08:05 -0400 Subject: [PATCH] command: run input commands after idle state is ready This makes sure that commands like show-text update the osd properly with --idle=yes. --- player/command.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/player/command.c b/player/command.c index 64d1b4d310..b41f13b874 100644 --- a/player/command.c +++ b/player/command.c @@ -7235,6 +7235,9 @@ static void command_event(struct MPContext *mpctx, int event, void *arg) if (event == MPV_EVENT_PLAYBACK_RESTART) ctx->last_seek_time = mp_time_sec(); + if (event == MPV_EVENT_IDLE) + run_command_opts(mpctx); + if (event == MPV_EVENT_END_FILE) mp_msg_flush_status_line(mpctx->log, false); @@ -7268,10 +7271,6 @@ void handle_command_updates(struct MPContext *mpctx) // Depends on polling demuxer wakeup callback notifications. cache_dump_poll(mpctx); - - // Potentially run the commands now (idle) instead of waiting for a file to load. - if (mpctx->stop_play == PT_STOP) - run_command_opts(mpctx); } void run_command_opts(struct MPContext *mpctx)