return ret;
p->samples32 = av_malloc_array(avctx->frame_size, sizeof(*p->samples32));
p->ref_coef = av_malloc_array(p->order, sizeof(*p->ref_coef));
- if (!p->samples32 || !p->ref_coef) {
- cng_encode_close(avctx);
+ if (!p->samples32 || !p->ref_coef)
return AVERROR(ENOMEM);
- }
return 0;
}
return 0;
}
-AVCodec ff_comfortnoise_encoder = {
+const AVCodec ff_comfortnoise_encoder = {
.name = "comfortnoise",
.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"),
.type = AVMEDIA_TYPE_AUDIO,
.close = cng_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};