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

wm4 nfxjfg at googlemail.com
Mon Jul 10 14:18:37 EEST 2017


On Mon, 10 Jul 2017 09:43:09 +0000
Kieran Kunhya <kierank at obe.tv> wrote:

> On Mon, 10 Jul 2017 at 10:39 wm4 <nfxjfg at googlemail.com> wrote:
> 
> >  
> > >      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;  
> >
> > That seems overly convoluted. Since you only want to move the
> > reference instead of creating a new one, you could just assign the
> > AVBufferRef pointer and assign the source field to NULL.
> >  
> 
> I can't do that, the source is const.

I don't understand. I don't see any const here, except on the src
AVCodecContext, which doesn't matter.


More information about the ffmpeg-devel mailing list