diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 8037499..46fbc59 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -390,16 +390,17 @@ typedef struct AVIndexEntry { int min_distance; /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */ } AVIndexEntry; -#define AV_DISPOSITION_DEFAULT 0x0001 -#define AV_DISPOSITION_DUB 0x0002 -#define AV_DISPOSITION_ORIGINAL 0x0004 -#define AV_DISPOSITION_COMMENT 0x0008 -#define AV_DISPOSITION_LYRICS 0x0010 -#define AV_DISPOSITION_KARAOKE 0x0020 +#define AV_DISPOSITION_DEFAULT 0x0001 +#define AV_DISPOSITION_DUB 0x0002 +#define AV_DISPOSITION_ORIGINAL 0x0004 +#define AV_DISPOSITION_COMMENT 0x0008 +#define AV_DISPOSITION_LYRICS 0x0010 +#define AV_DISPOSITION_KARAOKE 0x0020 +#define AV_DISPOSITION_HEARING_IMPAIRED 0x0040 /** Track should be used during playback by default. Useful for subtitle track that should be displayed even when user did not explicitly ask for subtitles. */ -#define AV_DISPOSITION_FORCED 0x0040 +#define AV_DISPOSITION_FORCED 0x0080 /** * Stream structure. diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index bb61e03..66fef44 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -569,6 +569,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, st->codec->codec_type = AVMEDIA_TYPE_DATA; st->codec->codec_id = CODEC_ID_NONE; st->need_parsing = AVSTREAM_PARSE_FULL; + st->disposition = 0; pes->st = st; pes->stream_type = stream_type; @@ -992,7 +993,20 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len language[1] = get8(&p, desc_end); language[2] = get8(&p, desc_end); language[3] = 0; - get8(&p, desc_end); + + /* hearing impaired subtitles detection */ + switch(get8(&p, desc_end)) { + case 0x20: /* DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality */ + case 0x21: /* DVB subtitles (for the hard of hearing) for display on 4:3 aspect ratio monitor */ + case 0x22: /* DVB subtitles (for the hard of hearing) for display on 16:9 aspect ratio monitor */ + case 0x23: /* DVB subtitles (for the hard of hearing) for display on 2.21:1 aspect ratio monitor */ + case 0x24: /* DVB subtitles (for the hard of hearing) for display on a high definition monitor */ + st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; + break; + default: + break; + } + comp_page = get16(&p, desc_end); anc_page = get16(&p, desc_end); st->codec->sub_id = (anc_page << 16) | comp_page;