From 1b398e99f735e141d88186d4e1a722b9a00f4b9a Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 17 Apr 2014 23:55:04 +0200 Subject: player: add a --loop-file option Unlike --loop, loops a file instead of the playlist. --- player/playloop.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 9ad9debfe1..31e8570589 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -825,6 +825,15 @@ static void handle_sstep(struct MPContext *mpctx) } } +static void handle_loop_file(struct MPContext *mpctx) +{ + struct MPOpts *opts = mpctx->opts; + if (opts->loop_file && mpctx->stop_play == AT_END_OF_FILE) { + set_osd_function(mpctx, OSD_FFW); + queue_seek(mpctx, MPSEEK_ABSOLUTE, get_start_time(mpctx), 0, true); + } +} + static void handle_keep_open(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; @@ -1282,6 +1291,8 @@ void run_playloop(struct MPContext *mpctx) handle_sstep(mpctx); + handle_loop_file(mpctx); + handle_keep_open(mpctx); handle_force_window(mpctx, false); -- cgit v1.2.3