summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-06-25 02:36:05 -0500
committersfan5 <sfan5@live.de>2023-06-25 11:01:58 +0200
commit5c4852d1730c415fc9311a39c6f7003d9c914792 (patch)
tree21e5e85311425a592234e82cdab7810e4d49584d /player
parentc6cacea4de72a341e2fc34866a5f3ab5a06e5722 (diff)
downloadmpv-5c4852d1730c415fc9311a39c6f7003d9c914792.tar.bz2
mpv-5c4852d1730c415fc9311a39c6f7003d9c914792.tar.xz
command: add sub-forced-only-cur prop
Diffstat (limited to 'player')
-rw-r--r--player/command.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 3155b1afd6..0eb13a7eed 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2943,6 +2943,18 @@ static int mp_property_sub_end(void *ctx, struct m_property *prop,
return m_property_double_ro(action, arg, end);
}
+static int mp_property_sub_forced_only_cur(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ int ret = mpctx->opts->subs_rend->forced_subs_only;
+ if (ret == -1) {
+ struct track *track = mpctx->current_track[0][STREAM_SUB];
+ ret = track && track->forced_only_def;
+ }
+ return m_property_bool_ro(action, arg, ret);
+}
+
static int mp_property_playlist_current_pos(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3899,6 +3911,7 @@ static const struct m_property mp_properties_base[] = {
.priv = (void *)&(const int){0}},
{"secondary-sub-end", mp_property_sub_end,
.priv = (void *)&(const int){1}},
+ {"sub-forced-only-cur", mp_property_sub_forced_only_cur},
{"vf", mp_property_vf},
{"af", mp_property_af},