diff options
author | karelrooted <karelrooted@gmail.com> | 2023-12-11 17:43:36 +0800 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-12-13 21:18:57 +0000 |
commit | 3250f6e4473b6c0ba1be03af3c80f3141b485721 (patch) | |
tree | c82c7957cfa5abee23ef144da56ed3c553d2cf07 /player/command.c | |
parent | b690531f3047f9eac85450457e04f67e2e2aa69b (diff) | |
download | mpv-3250f6e4473b6c0ba1be03af3c80f3141b485721.tar.bz2 mpv-3250f6e4473b6c0ba1be03af3c80f3141b485721.tar.xz |
options: add --secondary-sub-pos
The default value is 0 (on the top of the screen)
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c index 13de780a4d..ea78328c77 100644 --- a/player/command.c +++ b/player/command.c @@ -2910,6 +2910,18 @@ static int mp_property_sub_pos(void *ctx, struct m_property *prop, return mp_property_generic_option(mpctx, prop, action, arg); } +static int mp_property_secondary_sub_pos(void *ctx, struct m_property *prop, + int action, void *arg) +{ + MPContext *mpctx = ctx; + struct MPOpts *opts = mpctx->opts; + if (action == M_PROPERTY_PRINT) { + *(char **)arg = talloc_asprintf(NULL, "%4.2f%%/100", opts->subs_rend->sec_sub_pos); + return M_PROPERTY_OK; + } + return mp_property_generic_option(mpctx, prop, action, arg); +} + static int mp_property_sub_ass_extradata(void *ctx, struct m_property *prop, int action, void *arg) { @@ -3936,6 +3948,7 @@ static const struct m_property mp_properties_base[] = { .priv = (void *)&(const int){1}}, {"sub-speed", mp_property_sub_speed}, {"sub-pos", mp_property_sub_pos}, + {"secondary-sub-pos", mp_property_secondary_sub_pos}, {"sub-ass-extradata", mp_property_sub_ass_extradata}, {"sub-text", mp_property_sub_text, .priv = (void *)&(const int){SD_TEXT_TYPE_PLAIN}}, @@ -4249,6 +4262,7 @@ static const struct property_osd_display { {"sub", "Subtitles"}, {"secondary-sid", "Secondary subtitles"}, {"sub-pos", "Sub position"}, + {"secondary-sub-pos", "Secondary sub position"}, {"sub-delay", "Sub delay"}, {"secondary-sub-delay", "Secondary sub delay"}, {"sub-speed", "Sub speed"}, |