From 7ce464bef9c8ef13ca8343f24d126c468086a60f Mon Sep 17 00:00:00 2001 From: Philip Sequeira Date: Tue, 8 Oct 2013 23:51:00 -0400 Subject: options: --loop=N means playback N times, not N+1 times The argument or this change is that --loop should set how often the file is played, not the number of additional repeats. Based on pull request 277, with additions to the manpage and removal of "--loop=0". Signed-off-by: wm4 --- mpvcore/mplayer.c | 4 ++-- mpvcore/options.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mpvcore') diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index 7de8ff2abf..4d745cf107 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/mplayer.c @@ -4736,9 +4736,9 @@ struct playlist_entry *mp_next_file(struct MPContext *mpctx, int direction, if (mpctx->opts->shuffle) playlist_shuffle(mpctx->playlist); next = mpctx->playlist->first; - if (next && mpctx->opts->loop_times > 0) { + if (next && mpctx->opts->loop_times > 1) { mpctx->opts->loop_times--; - if (mpctx->opts->loop_times == 0) + if (mpctx->opts->loop_times == 1) mpctx->opts->loop_times = -1; } } else { diff --git a/mpvcore/options.c b/mpvcore/options.c index b0988bd6e2..b2da59c55d 100644 --- a/mpvcore/options.c +++ b/mpvcore/options.c @@ -681,8 +681,8 @@ const m_option_t mp_opts[] = { {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif - OPT_CHOICE_OR_INT("loop", loop_times, M_OPT_GLOBAL, 1, 10000, - ({"no", -1}, {"0", -1}, + OPT_CHOICE_OR_INT("loop", loop_times, M_OPT_GLOBAL, 2, 10000, + ({"no", -1}, {"1", -1}, {"inf", 0})), OPT_FLAG("resume-playback", position_resume, 0), -- cgit v1.2.3