summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
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 /player/playloop.c
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 'player/playloop.c')
-rw-r--r--player/playloop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 647a864513..b9e35b41eb 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -756,6 +756,8 @@ static void handle_loop_file(struct MPContext *mpctx)
mpctx->stop_play = KEEP_PLAYING;
set_osd_function(mpctx, OSD_FFW);
queue_seek(mpctx, MPSEEK_ABSOLUTE, get_start_time(mpctx), 0, true);
+ if (opts->loop_file > 0)
+ opts->loop_file--;
}
}