#include "avcodec.h"
#include "adx.h"
#include "get_bits.h"
+#include "internal.h"
/**
* @file
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
- avcodec_get_frame_defaults(&c->frame);
- avctx->coded_frame = &c->frame;
-
return 0;
}
static int adx_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
+ AVFrame *frame = data;
int buf_size = avpkt->size;
ADXContext *c = avctx->priv_data;
int16_t **samples;
}
/* get output buffer */
- c->frame.nb_samples = num_blocks * BLOCK_SAMPLES;
- if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
+ frame->nb_samples = num_blocks * BLOCK_SAMPLES;
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
- samples = (int16_t **)c->frame.extended_data;
+ samples = (int16_t **)frame->extended_data;
samples_offset = 0;
while (num_blocks--) {
samples_offset += BLOCK_SAMPLES;
}
- *got_frame_ptr = 1;
- *(AVFrame *)data = c->frame;
+ *got_frame_ptr = 1;
return buf - avpkt->data;
}
AVCodec ff_adpcm_adx_decoder = {
.name = "adpcm_adx",
+ .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_ADPCM_ADX,
.priv_data_size = sizeof(ADXContext),
.decode = adx_decode_frame,
.flush = adx_decode_flush,
.capabilities = CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
};