Skip to content

Commit

Permalink
player: expose hearing/visual impaired flags on audio tracks
Browse files Browse the repository at this point in the history
Signed-off-by: Aman Gupta <aman@tmm1.net>
  • Loading branch information
tmm1 authored and sfan5 committed Aug 13, 2018
1 parent c5d03d3 commit d5cad85
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions demux/demux_lavf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions demux/stheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions player/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions player/loadfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d5cad85

Please sign in to comment.