From 9fe076f02a67a87a79856e9583fc76aeb211c330 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 Sep 2014 22:56:00 +0200 Subject: 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. --- options/options.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'options/options.c') 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), -- cgit v1.2.3