]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/adxdec.c
arm: Remove a leftover define for the pld instruction
[ffmpeg] / libavcodec / adxdec.c
index 4d2892b4b2fc621c44e9888ae573b70ba8c571c3..17d5becc2b2b0efad195d644f2dff13e99dc0be6 100644 (file)
@@ -23,6 +23,7 @@
 #include "avcodec.h"
 #include "adx.h"
 #include "get_bits.h"
+#include "internal.h"
 
 /**
  * @file
@@ -51,9 +52,6 @@ static av_cold int adx_decode_init(AVCodecContext *avctx)
 
     avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
 
-    avcodec_get_frame_defaults(&c->frame);
-    avctx->coded_frame = &c->frame;
-
     return 0;
 }
 
@@ -97,6 +95,7 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
 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;
@@ -141,12 +140,12 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
     }
 
     /* 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--) {
@@ -162,8 +161,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
         samples_offset += BLOCK_SAMPLES;
     }
 
-    *got_frame_ptr   = 1;
-    *(AVFrame *)data = c->frame;
+    *got_frame_ptr = 1;
 
     return buf - avpkt->data;
 }
@@ -177,6 +175,7 @@ static void adx_decode_flush(AVCodecContext *avctx)
 
 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),
@@ -184,7 +183,6 @@ AVCodec ff_adpcm_adx_decoder = {
     .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 },
 };