command: run input commands after idle state is ready

This makes sure that commands like show-text update the osd properly
with --idle=yes.
This commit is contained in:
nanahi 2024-07-17 06:08:05 -04:00 committed by Dudemanguy
parent 481a5c0dc1
commit 503a896d1a
1 changed files with 3 additions and 4 deletions

View File

@ -7235,6 +7235,9 @@ static void command_event(struct MPContext *mpctx, int event, void *arg)
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();
if (event == MPV_EVENT_IDLE)
run_command_opts(mpctx);
if (event == MPV_EVENT_END_FILE) if (event == MPV_EVENT_END_FILE)
mp_msg_flush_status_line(mpctx->log, false); 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. // Depends on polling demuxer wakeup callback notifications.
cache_dump_poll(mpctx); 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) void run_command_opts(struct MPContext *mpctx)