[FFmpeg-devel] [PATCH] mpeg12enc: Use Closed Captions if available

Devin Heitmueller dheitmueller at ltnglobal.com
Thu Feb 7 20:21:14 EET 2019


> On Feb 7, 2019, at 1:11 PM, Mathieu Duponchelle <mathieu at centricular.com> wrote:
> +            if (side_data->size <= 96) {

Isn’t this calculation incorrect?  The max cc_count possible is 31 (0x1F), hence the max size should be 93.

> +                int i = 0;
> +
> +                put_header (s, USER_START_CODE);
> +
> +                put_bits(&s->pb, 8, 'G');                   // user_identifier
> +                put_bits(&s->pb, 8, 'A');
> +                put_bits(&s->pb, 8, '9');
> +                put_bits(&s->pb, 8, '4');
> +                put_bits(&s->pb, 8, 3);                     // user_data_type_code
> +                put_bits(&s->pb, 8,
> +                    ((side_data->size / 3) & 0x1f) | 0x40); // flags, cc_count
> +                put_bits(&s->pb, 8, 0xff);                  // em_data


---
Devin Heitmueller - LTN Global Communications
dheitmueller at ltnglobal.com




More information about the ffmpeg-devel mailing list