#include "dsputil.h"
#include "get_bits.h"
#include "bytestream.h"
+#include "libavutil/audioconvert.h"
/**
- * @file libavcodec/apedec.c
+ * @file
* Monkey's Audio lossless audio decoder
*/
}
dsputil_init(&s->dsp, avctx);
- avctx->sample_fmt = SAMPLE_FMT_S16;
- avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+ avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
return 0;
}
for (i = 0; i < APE_FILTER_LEVELS; i++)
av_freep(&s->filterbuf[i]);
+ av_freep(&s->data);
return 0;
}
return bytes_used;
}
-AVCodec ape_decoder = {
+static void ape_flush(AVCodecContext *avctx)
+{
+ APEContext *s = avctx->priv_data;
+ s->samples= 0;
+}
+
+AVCodec ff_ape_decoder = {
"ape",
- CODEC_TYPE_AUDIO,
+ AVMEDIA_TYPE_AUDIO,
CODEC_ID_APE,
sizeof(APEContext),
ape_decode_init,
ape_decode_close,
ape_decode_frame,
.capabilities = CODEC_CAP_SUBFRAMES,
+ .flush = ape_flush,
.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
};