From f93419f6b223546d36580ad37ca2644c0c4bb971 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 10 Oct 2014 14:44:22 +0200 Subject: player: --save-position-on-quit should always work (2) This reimplements the feature reverted in the previous commit in a different way. --- player/command.c | 7 +++++-- player/loadfile.c | 3 --- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/player/command.c b/player/command.c index 758a62a8d9..f0d96bd509 100644 --- a/player/command.c +++ b/player/command.c @@ -3663,7 +3663,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_QUIT: case MP_CMD_QUIT_WATCH_LATER: - if (cmd->id == MP_CMD_QUIT_WATCH_LATER) + if (cmd->id == MP_CMD_QUIT_WATCH_LATER || opts->position_save_on_quit) mp_write_watch_later_conf(mpctx); mpctx->stop_play = PT_QUIT; mpctx->quit_custom_rc = cmd->args[0].v.i; @@ -3764,8 +3764,11 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) } playlist_add(mpctx->playlist, entry); - if (!append || (append == 2 && !mpctx->playlist->current)) + if (!append || (append == 2 && !mpctx->playlist->current)) { + if (opts->position_save_on_quit) // requested in issue #1148 + mp_write_watch_later_conf(mpctx); mp_set_playlist_entry(mpctx, mpctx->playlist->first); + } break; } diff --git a/player/loadfile.c b/player/loadfile.c index ac1d765619..a30c491227 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1194,9 +1194,6 @@ terminate_playback: if (mpctx->stop_play != AT_END_OF_FILE) clear_audio_output_buffers(mpctx); - if (opts->position_save_on_quit && mpctx->stop_play == PT_QUIT) - mp_write_watch_later_conf(mpctx); - if (mpctx->step_frames) opts->pause = 1; -- cgit v1.2.3