From e9fc53a10b889c5add90364ded20d0448b88f93a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 8 Feb 2020 14:57:45 +0100 Subject: player: add ab-loop-count option/property As requested I guess. It behaves quite similar to the --loop* options. Not quite happy with the idea that 1) the option is mutated on each operation (but at least it's consistent with --loop* and doesn't require more properties), and 2) the ab-loop command will do nothing once all loop iterations are done. As a concession, the OSD shows something about "disabled". Fixes: #7360 --- player/playloop.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 86f19fd79f..4f0efad275 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -885,6 +885,10 @@ static void handle_loop_file(struct MPContext *mpctx) double ab[2]; if (get_ab_loop_times(mpctx, ab) && mpctx->ab_loop_clip) { + if (opts->ab_loop_count > 0) { + opts->ab_loop_count--; + m_config_notify_change_opt_ptr(mpctx->mconfig, &opts->ab_loop_count); + } target = ab[0]; prec = MPSEEK_EXACT; } else if (opts->loop_file) { -- cgit v1.2.3