diff mbox

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

Message ID 20170217214115.99553-1-josh@itanimul.li
State New
Headers show

Commit Message

Josh Dekker Feb. 17, 2017, 9:41 p.m. UTC
Signed-off-by: Josh de Kock <josh@itanimul.li>
---
 libavformat/mpegts.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Marton Balint Feb. 18, 2017, midnight UTC | #1
On Fri, 17 Feb 2017, Josh de Kock wrote:

> Signed-off-by: Josh de Kock <josh@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) */

ok.

>             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] */

I am not sure this is useful, because it is irrelevant here, also not 
entirely true, e.g. magazine 0 means 8xx page.


>                     extradata += 2;
>
>                     *pp += 2;

Regards,
Marton
diff mbox

Patch

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;