summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-08 14:57:45 +0100
committerwm4 <wm4@nowhere>2020-02-08 15:01:33 +0100
commite9fc53a10b889c5add90364ded20d0448b88f93a (patch)
tree772500ffe7bf01a1d4382ae68b3e872379bc9f72 /options
parent3fb0cc203bf0e5595e209e6b3eb3da3bb5e54a3a (diff)
downloadmpv-e9fc53a10b889c5add90364ded20d0448b88f93a.tar.bz2
mpv-e9fc53a10b889c5add90364ded20d0448b88f93a.tar.xz
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
Diffstat (limited to 'options')
-rw-r--r--options/options.c3
-rw-r--r--options/options.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c
index 7eccfa03fb..d2388bcf07 100644
--- a/options/options.c
+++ b/options/options.c
@@ -427,6 +427,8 @@ static const m_option_t mp_opts[] = {
OPT_TIME("ab-loop-a", ab_loop[0], 0, .min = MP_NOPTS_VALUE),
OPT_TIME("ab-loop-b", ab_loop[1], 0, .min = MP_NOPTS_VALUE),
+ OPT_CHOICE_OR_INT("ab-loop-count", ab_loop_count, 0, 0, INT_MAX,
+ ({"inf", -1})),
OPT_CHOICE_OR_INT("playlist-start", playlist_pos, 0, 0, INT_MAX,
({"auto", -1}, {"no", -1})),
@@ -940,6 +942,7 @@ static const struct MPOpts mp_default_opts = {
.cache_pause = 1,
.cache_pause_wait = 1.0,
.ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE},
+ .ab_loop_count = -1,
.edition_id = -1,
.default_max_pts_correction = -1,
.correct_pts = 1,
diff --git a/options/options.h b/options/options.h
index 06321d2fe2..bc0f1b3e89 100644
--- a/options/options.h
+++ b/options/options.h
@@ -232,6 +232,7 @@ typedef struct MPOpts {
int rebase_start_time;
int play_frames;
double ab_loop[2];
+ int ab_loop_count;
double step_sec;
int position_resume;
int position_check_mtime;