From b8d498da1588891ff5c13c312f6d83f310fad963 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Sep 2013 17:08:52 +0200 Subject: mplayer: always write playback resume info, even at start/end of file Before this commit, the player didn't write resume info if the playback position was within the first or last percent of the file. This was sometimes annoying, and with playlist resume can lead to unintuitive behavior. (It wouldn't resume the playlist if the currently played file was at 0-1% or 99-100%, even if you were in the middle of a playlist.) Moreover, the "percent > 99" check is a bit bogus anyway, because 100 (in integer) is rarely reached. Drop the check, and make sure using --save-position-on-quit won't write resume info when reaching EOF. The latter check is needed to make sure playback of the file starts at beginning when playing it again after EOF. --- mpvcore/mplayer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mpvcore/mplayer.c') diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index 8918be3615..a0965f46bf 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/mplayer.c @@ -857,8 +857,7 @@ void mp_write_watch_later_conf(struct MPContext *mpctx) goto exit; double pos = get_current_time(mpctx); - int percent = get_percent_pos(mpctx); - if (percent < 1 || percent > 99 || pos == MP_NOPTS_VALUE) + if (pos == MP_NOPTS_VALUE) goto exit; mk_config_dir(MP_WATCH_LATER_CONF); @@ -4471,7 +4470,8 @@ goto_reopen_demuxer: ; terminate_playback: // don't jump here after ao/vo/getch initialization! - if (opts->position_save_on_quit && mpctx->stop_play != PT_RESTART) + if (opts->position_save_on_quit && mpctx->stop_play != PT_RESTART && + mpctx->stop_play != AT_END_OF_FILE) mp_write_watch_later_conf(mpctx); if (mpctx->step_frames) -- cgit v1.2.3