[FFmpeg-devel] [PATCH] h264: Support multi-field closed captions by using AVBufferRef and not resetting per field

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Aug 17 12:10:21 EEST 2018


2018-08-16 12:52 GMT+02:00, joshdk at ob-encoder.com <joshdk at ob-encoder.com>:

> @@ -429,6 +429,12 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
>                         MAX_DELAYED_PIC_COUNT + 2, h, h1);
>
>      h->frame_recovered       = h1->frame_recovered;
> +    if (h1->sei.a53_caption.buf_ref) {
> +        h->sei.a53_caption.buf_ref =
> av_buffer_ref(h1->sei.a53_caption.buf_ref);
> +        av_buffer_unref(&h1->sei.a53_caption.buf_ref);
> +    }
> +    else
> +        h->sei.a53_caption.buf_ref = NULL;

Since you have to change the patch, please fix the
code style here.
(Some people prefer to always use two braces around "else",
it makes debugging much easier.)

Carl Eugen


More information about the ffmpeg-devel mailing list