mirror of https://github.com/mpv-player/mpv
playloop: move run_command_opts to command_event for playback-restart
This commit is contained in:
parent
503a896d1a
commit
58f3009b80
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue