Skip to content

Commit

Permalink
Flag DVB subtitles for the hard hearing appropriately using their com…
Browse files Browse the repository at this point in the history
…ponent_type id.

This is based on the component_type definition in the DVB SI spec [1].

[1]: http://www.dvb.org/technology/standards/a038_DVB-SI_dEN300468v1.12.1.pdf

Signed-off-by: Ronald S. Bultje <[email protected]>
  • Loading branch information
Nevcairiel authored and rbultje committed Mar 7, 2011
1 parent 435cebd commit 789936d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion libavformat/mpegts.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,17 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
language[1] = get8(pp, desc_end);
language[2] = get8(pp, desc_end);
language[3] = 0;
get8(pp, desc_end);
/* hearing impaired subtitles detection */
switch(get8(pp, 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 */
case 0x25: /* DVB subtitles (for the hard of hearing) with plano-stereoscopic disparity for display on a high definition monitor */
st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED;
break;
}
if (st->codec->extradata) {
if (st->codec->extradata_size == 4 && memcmp(st->codec->extradata, *pp, 4))
av_log_ask_for_sample(fc, "DVB sub with multiple IDs\n");
Expand Down

0 comments on commit 789936d

Please sign in to comment.