summaryrefslogtreecommitdiffstats
path: root/mpvcore/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-04 17:08:52 +0200
committerwm4 <wm4@nowhere>2013-09-04 17:08:52 +0200
commitb8d498da1588891ff5c13c312f6d83f310fad963 (patch)
treee46eb31ae4b6d800a42ef23a4bef0c80a12963b4 /mpvcore/mplayer.c
parent191ac00af277f0d798716e2e8d0419656c011b52 (diff)
downloadmpv-b8d498da1588891ff5c13c312f6d83f310fad963.tar.bz2
mpv-b8d498da1588891ff5c13c312f6d83f310fad963.tar.xz
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.
Diffstat (limited to 'mpvcore/mplayer.c')
-rw-r--r--mpvcore/mplayer.c6
1 files changed, 3 insertions, 3 deletions
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)