[FFmpeg-devel] [PATCH] lavf/mpegts: document DVB teletext PMT fields

Josh de Kock josh at itanimul.li
Fri Feb 17 23:41:15 EET 2017


Signed-off-by: Josh de Kock <josh at itanimul.li>
---
 libavformat/mpegts.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 590abb0..bcf2118 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1718,6 +1718,11 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
     case 0x56: /* DVB teletext descriptor */
         {
             uint8_t *extradata = NULL;
+            /* 5 bytes per DVB teletext substream data:
+             * ISO_639_language_code (3 bytes),
+             * teletext_type (5 bits),
+             * teletext_magazine_number (3 bits),
+             * teletext_page_number (1 byte) */
             int language_count = desc_len / 5;
 
             if (desc_len > 0 && desc_len % 5 != 0)
@@ -1745,6 +1750,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
                     language[i * 4 + 3] = ',';
 
                     memcpy(extradata, *pp, 2);
+                    /* The page number which libzvbi will output is extradata[0] & 7 * 256 + extradata[1] */
                     extradata += 2;
 
                     *pp += 2;
-- 
2.10.1 (Apple Git-78)



More information about the ffmpeg-devel mailing list