diff options
author | Aman Gupta <aman@tmm1.net> | 2018-07-26 12:53:14 -0700 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2018-08-13 19:09:44 +0200 |
commit | d5cad856255cb0e74461f9d6613f561c6f347a0f (patch) | |
tree | 10cecc501f428b455f123b51f343d3f6beea79a3 | |
parent | c5d03d338ecd46d7170733822c37da4be027296f (diff) |
player: expose hearing/visual impaired flags on audio tracks
Signed-off-by: Aman Gupta <aman@tmm1.net>
-rw-r--r-- | demux/demux_lavf.c | 4 | ||||
-rw-r--r-- | demux/stheader.h | 2 | ||||
-rw-r--r-- | player/command.c | 2 | ||||
-rw-r--r-- | player/core.h | 1 | ||||
-rw-r--r-- | player/loadfile.c | 3 |
5 files changed, 12 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 83cce14bc2..01f99ae6fa 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -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) diff --git a/demux/stheader.h b/demux/stheader.h index 63744487bf..beca0fabf7 100644 --- a/demux/stheader.h +++ b/demux/stheader.h @@ -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; diff --git a/player/command.c b/player/command.c index 87cd274d57..7237b08820 100644 --- a/player/command.c +++ b/player/command.c @@ -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), diff --git a/player/core.h b/player/core.h index 5ccf35fd1a..c740b76f22 100644 --- a/player/core.h +++ b/player/core.h @@ -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; diff --git a/player/loadfile.c b/player/loadfile.c index 56aca7d30c..43d401dc06 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -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, |