summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-22 22:56:00 +0200
committerwm4 <wm4@nowhere>2014-09-22 22:56:00 +0200
commit9fe076f02a67a87a79856e9583fc76aeb211c330 (patch)
tree80e9d226bbd700f26bb829fa35b7147b239948e7 /options
parent9ce45261399e2ee99f468c5016b378fd5360ae12 (diff)
downloadmpv-9fe076f02a67a87a79856e9583fc76aeb211c330.tar.bz2
mpv-9fe076f02a67a87a79856e9583fc76aeb211c330.tar.xz
player: allow passing number of loops to --loop-file
E.g. --loop-file=2 will play the file 3 times (one time normally, and 2 repeats). Minor syntax issue: "--loop-file 5" won't work, you have to use "--loop-file=5". This is because "--loop-file" still has to work for compatibility, so the "old" syntax with a space between option name and value can't work.
Diffstat (limited to 'options')
-rw-r--r--options/options.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/options/options.c b/options/options.c
index 5085366389..0e570705ef 100644
--- a/options/options.c
+++ b/options/options.c
@@ -481,7 +481,9 @@ const m_option_t mp_opts[] = {
OPT_CHOICE_OR_INT("loop", loop_times, M_OPT_GLOBAL, 2, 10000,
({"no", -1}, {"1", -1},
{"inf", 0})),
- OPT_FLAG("loop-file", loop_file, 0),
+ OPT_CHOICE_OR_INT("loop-file", loop_file, M_OPT_OPTIONAL_PARAM, 0, 10000,
+ ({"yes", -1}, {"", -1}, {"no", 0}, // compat
+ {"inf", -1})),
OPT_FLAG("resume-playback", position_resume, 0),
OPT_FLAG("save-position-on-quit", position_save_on_quit, 0),