[FFmpeg-devel] [PATCH v5] Added Turing codec interface for ffmpeg

wm4 nfxjfg at googlemail.com
Wed Feb 8 15:37:31 EET 2017


On Wed, 8 Feb 2017 13:05:40 +0000
Mark Thompson <sw at jkqxz.net> wrote:

> On 08/02/17 08:41, Saverio Blasi wrote:

> > +        avctx->extradata = av_malloc(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
> > +        if (!avctx->extradata) {
> > +            av_log(avctx, AV_LOG_ERROR, "Failed to allocate HEVC extradata %d bytes\n", avctx->extradata_size);
> > +            av_freep(&encoder_options.argv);
> > +            av_freep(&encoder_options.options);
> > +            turing_destroy_encoder(ctx->encoder);
> > +            return AVERROR(ENOMEM);  
> 
> This cleanup code is copied multiple times, maybe replace them all with a single "fail" path at the end and goto it?  (Like optionfail, but without the message and preserving the error code.)
> 

Could also set FF_CODEC_CAP_INIT_CLEANUP, which will call the close
callback if init fails.


More information about the ffmpeg-devel mailing list