[FFmpeg-devel] [PATCH 1/4] mpegts: set st->disposition according to ISO 639 language descriptor

Anssi Hannula anssi.hannula
Sat Feb 12 19:24:38 CET 2011


The descriptor is defined in ISO/IEC 13818-1.
---
 libavformat/mpegts.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index e8d82ac..0e2f71c 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -954,6 +954,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
         language[2] = get8(pp, desc_end);
         language[3] = 0;
         av_metadata_set2(&st->metadata, "language", language, 0);
+        switch (get8(pp, desc_end)) {
+            case 0x01: st->disposition |= AV_DISPOSITION_KARAOKE; break;
+            case 0x02: st->disposition |= AV_DISPOSITION_HEARING_IMPAIRED; break;
+            case 0x03: st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED; break;
+            default: break;
+        }
         break;
     case 0x05: /* registration descriptor */
         st->codec->codec_tag = bytestream_get_le32(pp);
-- 
1.7.3




More information about the ffmpeg-devel mailing list