mirror of
https://github.com/mpv-player/mpv
synced 2024-12-15 03:15:52 +00:00
player: --save-position-on-quit should always work (2)
This reimplements the feature reverted in the previous commit in a different way.
This commit is contained in:
parent
d4b2a96d90
commit
f93419f6b2
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user