]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/nellymoserdec.c
wmalosslessdec: fix mclms_coeffs* array size
[ffmpeg] / libavcodec / nellymoserdec.c
index 08cc4ab15b7444a71343ecfa7101b9b310775175..3b9b77cc530aa25598db9bbac11786774f3af9d2 100644 (file)
@@ -36,7 +36,6 @@
 #include "libavutil/lfg.h"
 #include "libavutil/random_seed.h"
 #include "avcodec.h"
-#include "dsputil.h"
 #include "fft.h"
 #include "fmtconvert.h"
 #include "internal.h"
@@ -49,7 +48,6 @@
 
 typedef struct NellyMoserDecodeContext {
     AVCodecContext* avctx;
-    AVFrame         frame;
     AVLFG           random_state;
     GetBitContext   gb;
     float           scale_bias;
@@ -136,15 +134,13 @@ static av_cold int decode_init(AVCodecContext * avctx) {
     avctx->channels       = 1;
     avctx->channel_layout = AV_CH_LAYOUT_MONO;
 
-    avcodec_get_frame_defaults(&s->frame);
-    avctx->coded_frame = &s->frame;
-
     return 0;
 }
 
 static int decode_tag(AVCodecContext *avctx, void *data,
                       int *got_frame_ptr, AVPacket *avpkt)
 {
+    AVFrame *frame     = data;
     const uint8_t *buf = avpkt->data;
     int buf_size = avpkt->size;
     NellyMoserDecodeContext *s = avctx->priv_data;
@@ -169,12 +165,12 @@ static int decode_tag(AVCodecContext *avctx, void *data,
      */
 
     /* get output buffer */
-    s->frame.nb_samples = NELLY_SAMPLES * blocks;
-    if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
+    frame->nb_samples = NELLY_SAMPLES * blocks;
+    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;
     }
-    samples_flt = (float   *)s->frame.data[0];
+    samples_flt = (float *)frame->data[0];
 
     for (i=0 ; i<blocks ; i++) {
         nelly_decode_block(s, buf, samples_flt);
@@ -182,8 +178,7 @@ static int decode_tag(AVCodecContext *avctx, void *data,
         buf += NELLY_BLOCK_LEN;
     }
 
-    *got_frame_ptr   = 1;
-    *(AVFrame *)data = s->frame;
+    *got_frame_ptr = 1;
 
     return buf_size;
 }
@@ -198,6 +193,7 @@ static av_cold int decode_end(AVCodecContext * avctx) {
 
 AVCodec ff_nellymoser_decoder = {
     .name           = "nellymoser",
+    .long_name      = NULL_IF_CONFIG_SMALL("Nellymoser Asao"),
     .type           = AVMEDIA_TYPE_AUDIO,
     .id             = AV_CODEC_ID_NELLYMOSER,
     .priv_data_size = sizeof(NellyMoserDecodeContext),
@@ -205,7 +201,6 @@ AVCodec ff_nellymoser_decoder = {
     .close          = decode_end,
     .decode         = decode_tag,
     .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_PARAM_CHANGE,
-    .long_name      = NULL_IF_CONFIG_SMALL("Nellymoser Asao"),
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
                                                       AV_SAMPLE_FMT_NONE },
 };