mirror of https://github.com/mpv-player/mpv
command: add sub-forced-only-cur prop
This commit is contained in:
parent
c6cacea4de
commit
5c4852d173
|
@ -2712,6 +2712,9 @@ Property list
|
||||||
``secondary-sub-end``
|
``secondary-sub-end``
|
||||||
Same as ``sub-end``, but for the secondary subtitles.
|
Same as ``sub-end``, but for the secondary subtitles.
|
||||||
|
|
||||||
|
``sub-forced-only-cur``
|
||||||
|
Read-only - whether the current subtitle track is being shown in forced-only mode.
|
||||||
|
|
||||||
``playlist-pos`` (RW)
|
``playlist-pos`` (RW)
|
||||||
Current position on playlist. The first entry is on position 0. Writing to
|
Current position on playlist. The first entry is on position 0. Writing to
|
||||||
this property may start playback at the new position.
|
this property may start playback at the new position.
|
||||||
|
|
|
@ -2943,6 +2943,18 @@ static int mp_property_sub_end(void *ctx, struct m_property *prop,
|
||||||
return m_property_double_ro(action, arg, end);
|
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,
|
static int mp_property_playlist_current_pos(void *ctx, struct m_property *prop,
|
||||||
int action, void *arg)
|
int action, void *arg)
|
||||||
{
|
{
|
||||||
|
@ -3899,6 +3911,7 @@ static const struct m_property mp_properties_base[] = {
|
||||||
.priv = (void *)&(const int){0}},
|
.priv = (void *)&(const int){0}},
|
||||||
{"secondary-sub-end", mp_property_sub_end,
|
{"secondary-sub-end", mp_property_sub_end,
|
||||||
.priv = (void *)&(const int){1}},
|
.priv = (void *)&(const int){1}},
|
||||||
|
{"sub-forced-only-cur", mp_property_sub_forced_only_cur},
|
||||||
|
|
||||||
{"vf", mp_property_vf},
|
{"vf", mp_property_vf},
|
||||||
{"af", mp_property_af},
|
{"af", mp_property_af},
|
||||||
|
|
Loading…
Reference in New Issue