-AVCodec mpc7_decoder = {
- "mpc7",
- CODEC_TYPE_AUDIO,
- CODEC_ID_MUSEPACK7,
- sizeof(MPCContext),
- mpc7_decode_init,
- NULL,
- NULL,
- mpc7_decode_frame,
- .flush = mpc7_decode_flush,
- .long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"),
+static av_cold int mpc7_decode_close(AVCodecContext *avctx)
+{
+ MPCContext *c = avctx->priv_data;
+ av_freep(&c->bits);
+ c->buf_size = 0;
+ return 0;
+}
+
+AVCodec ff_mpc7_decoder = {
+ .name = "mpc7",
+ .long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_MUSEPACK7,
+ .priv_data_size = sizeof(MPCContext),
+ .init = mpc7_decode_init,
+ .close = mpc7_decode_close,
+ .decode = mpc7_decode_frame,
+ .flush = mpc7_decode_flush,
+ .capabilities = CODEC_CAP_DR1,
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
+ AV_SAMPLE_FMT_NONE },