avcodec: Remove redundant freeing of extradata of encoders

AVCodecContext.extradata is freed generically by libavcodec for
encoders, so it is unnecessary for an encoder to do it on its own.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-04-15 01:49:06 +02:00
parent 1ab74bc193
commit 1c7f252783
15 changed files with 0 additions and 21 deletions

View File

@ -1413,8 +1413,6 @@ static av_cold int flac_encode_close(AVCodecContext *avctx)
av_freep(&s->md5_buffer);
ff_lpc_end(&s->lpc_ctx);
}
av_freep(&avctx->extradata);
avctx->extradata_size = 0;
return 0;
}

View File

@ -1005,7 +1005,6 @@ static av_cold int encode_end(AVCodecContext *avctx)
ff_huffyuv_common_end(s);
av_freep(&avctx->extradata);
av_freep(&avctx->stats_out);
return 0;

View File

@ -154,7 +154,6 @@ static av_cold int encode_end(AVCodecContext *avctx)
{
LclEncContext *c = avctx->priv_data;
av_freep(&avctx->extradata);
deflateEnd(&c->zstream);
return 0;

View File

@ -112,7 +112,6 @@ static int aac_encode_close(AVCodecContext *avctx)
if (s->handle)
aacEncClose(&s->handle);
av_freep(&avctx->extradata);
ff_af_queue_close(&s->afq);
return 0;

View File

@ -156,9 +156,6 @@ static av_cold int libkvazaar_close(AVCodecContext *avctx)
ctx->api->config_destroy(ctx->config);
}
if (avctx->extradata)
av_freep(&avctx->extradata);
return 0;
}

View File

@ -432,7 +432,6 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx)
fail:
opus_multistream_encoder_destroy(enc);
av_freep(&avctx->extradata);
return ret;
}
@ -538,7 +537,6 @@ static av_cold int libopus_encode_close(AVCodecContext *avctx)
ff_af_queue_close(&opus->afq);
av_freep(&opus->samples);
av_freep(&avctx->extradata);
return 0;
}

View File

@ -318,7 +318,6 @@ static av_cold int encode_close(AVCodecContext *avctx)
speex_encoder_destroy(s->enc_state);
ff_af_queue_close(&s->afq);
av_freep(&avctx->extradata);
return 0;
}

View File

@ -360,7 +360,6 @@ static av_cold int encode_close(AVCodecContext* avc_context)
th_encode_free(h->t_state);
av_freep(&h->stats);
av_freep(&avc_context->stats_out);
av_freep(&avc_context->extradata);
avc_context->extradata_size = 0;
return 0;

View File

@ -196,7 +196,6 @@ static av_cold int libvorbis_encode_close(AVCodecContext *avctx)
av_fifo_freep(&s->pkt_fifo);
ff_af_queue_close(&s->afq);
av_freep(&avctx->extradata);
av_vorbis_parse_free(&s->vp);

View File

@ -497,7 +497,6 @@ static av_cold int X264_close(AVCodecContext *avctx)
{
X264Context *x4 = avctx->priv_data;
av_freep(&avctx->extradata);
av_freep(&x4->sei);
av_freep(&x4->reordered_opaque);

View File

@ -207,7 +207,6 @@ static av_cold int XAVS_close(AVCodecContext *avctx)
{
XavsContext *x4 = avctx->priv_data;
av_freep(&avctx->extradata);
av_freep(&x4->sei);
av_freep(&x4->pts_buffer);

View File

@ -858,7 +858,6 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx)
x->encoder_handle = NULL;
}
av_freep(&avctx->extradata);
if (x->twopassbuffer) {
av_freep(&x->twopassbuffer);
av_freep(&x->old_twopassbuffer);

View File

@ -961,8 +961,6 @@ av_cold int ff_mpv_encode_end(AVCodecContext *avctx)
s->out_format == FMT_MJPEG)
ff_mjpeg_encode_close(s);
av_freep(&avctx->extradata);
for (i = 0; i < FF_ARRAY_ELEMS(s->tmp_frames); i++)
av_frame_free(&s->tmp_frames[i]);

View File

@ -614,7 +614,6 @@ static av_cold int opus_encode_end(AVCodecContext *avctx)
ff_af_queue_close(&s->afq);
ff_opus_psy_end(&s->psyctx);
ff_bufqueue_discard_all(&s->bufqueue);
av_freep(&avctx->extradata);
return 0;
}

View File

@ -1254,8 +1254,6 @@ static av_cold int vorbis_encode_close(AVCodecContext *avctx)
ff_af_queue_close(&venc->afq);
ff_bufqueue_discard_all(&venc->bufqueue);
av_freep(&avctx->extradata);
return 0 ;
}