1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 16:33:02 +00:00

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.
This commit is contained in:
wm4 2013-09-04 17:08:52 +02:00
parent 191ac00af2
commit b8d498da15

View File

@ -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)