mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
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``
|
||||
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)
|
||||
Current position on playlist. The first entry is on position 0. Writing to
|
||||
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);
|
||||
}
|
||||
|
||||
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},
|
||||
|
Loading…
Reference in New Issue
Block a user