From a078d07ea25b35d48b27881003c11781dda7af21 Mon Sep 17 00:00:00 2001 From: Mikhail Rudenko Date: Wed, 20 May 2020 00:03:49 +0300 Subject: command: save state on stop when user requested save-position-on-quit Execution of "stop" command in the case when idle mode was not enabled resulted in player termination scenario not honoring user setting "save-position-on-quit" from config file. This patch addresses the issue by checking for "save-position-on-quit" in cmd_stop and saving state when idle mode is not enabled. --- player/command.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/player/command.c b/player/command.c index 45b721ef09..c6219676cf 100644 --- a/player/command.c +++ b/player/command.c @@ -5085,6 +5085,13 @@ static void cmd_stop(void *p) if (!(flags & 1)) playlist_clear(mpctx->playlist); + + if (mpctx->opts->player_idle_mode < 2 && + mpctx->opts->position_save_on_quit) + { + mp_write_watch_later_conf(mpctx); + } + if (mpctx->stop_play != PT_QUIT) mpctx->stop_play = PT_STOP; mp_wakeup_core(mpctx); -- cgit v1.2.3