0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

player: expose hearing/visual impaired flags on audio tracks

Signed-off-by: Aman Gupta <aman@tmm1.net>
This commit is contained in:
Aman Gupta 2018-07-26 12:53:14 -07:00 committed by sfan5
parent c5d03d338e
commit d5cad85625
5 changed files with 12 additions and 0 deletions

View File

@ -715,6 +715,10 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
sh->forced_track = true;
if (st->disposition & AV_DISPOSITION_DEPENDENT)
sh->dependent_track = true;
if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED)
sh->visual_impaired_track = true;
if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
sh->hearing_impaired_track = true;
if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
sh->still_image = true;
if (priv->format_hack.use_stream_ids)

View File

@ -46,6 +46,8 @@ struct sh_stream {
bool default_track; // container default track flag
bool forced_track; // container forced track flag
bool dependent_track; // container dependent track flag
bool visual_impaired_track; // container flag
bool hearing_impaired_track;// container flag
bool still_image; // video stream contains still images
int hls_bitrate;

View File

@ -2250,6 +2250,8 @@ static int get_track_entry(int item, int action, void *arg, void *ctx)
{"default", SUB_PROP_FLAG(track->default_track)},
{"forced", SUB_PROP_FLAG(track->forced_track)},
{"dependent", SUB_PROP_FLAG(track->dependent_track)},
{"visual-impaired", SUB_PROP_FLAG(track->visual_impaired_track)},
{"hearing-impaired", SUB_PROP_FLAG(track->hearing_impaired_track)},
{"external", SUB_PROP_FLAG(track->is_external)},
{"selected", SUB_PROP_FLAG(track->selected)},
{"external-filename", SUB_PROP_STR(track->external_filename),

View File

@ -134,6 +134,7 @@ struct track {
char *title;
bool default_track, forced_track, dependent_track;
bool visual_impaired_track, hearing_impaired_track;
bool attached_picture;
char *lang;

View File

@ -279,6 +279,9 @@ static struct track *add_stream_track(struct MPContext *mpctx,
.title = stream->title,
.default_track = stream->default_track,
.forced_track = stream->forced_track,
.dependent_track = stream->dependent_track,
.visual_impaired_track = stream->visual_impaired_track,
.hearing_impaired_track = stream->hearing_impaired_track,
.attached_picture = stream->attached_picture != NULL,
.lang = stream->lang,
.demuxer = demuxer,