Merge commit 'b01a2204b5cff7bb920f42fda1bb0103f450fe93'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 17 Oct 2014 18:35:43 +0000 (20:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 17 Oct 2014 18:35:43 +0000 (20:35 +0200)
* commit 'b01a2204b5cff7bb920f42fda1bb0103f450fe93':
  libfdk-aacdec: Enable Decoder Downmix including Downmix Metadata Support

Conflicts:
libavcodec/libfdk-aacdec.c
libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/libfdk-aacdec.c
libavcodec/version.h

@@@ -223,16 -273,28 +273,26 @@@ static int fdk_aac_decode_frame(AVCodec
  
      if (s->initialized) {
          frame->nb_samples = avctx->frame_size;
 -        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
 -            av_log(avctx, AV_LOG_ERROR, "ff_get_buffer() failed\n");
 +        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
              return ret;
-         buf = frame->extended_data[0];
-         buf_size = avctx->channels * frame->nb_samples *
-                    av_get_bytes_per_sample(avctx->sample_fmt);
 -        }
+         if (s->anc_buffer) {
+             buf_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
+             buf = s->decoder_buffer;
+         } else {
+             buf = frame->extended_data[0];
+             buf_size = avctx->channels * frame->nb_samples *
+                        av_get_bytes_per_sample(avctx->sample_fmt);
+         }
      } else {
-         buf_size = 50 * 1024;
-         buf = tmpptr = av_malloc(buf_size);
-         if (!buf)
+         buf_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;
+         if (!s->decoder_buffer)
+             s->decoder_buffer = av_malloc(buf_size);
+         if (!s->decoder_buffer)
              return AVERROR(ENOMEM);
+         buf = tmpptr = s->decoder_buffer;
      }
  
      err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) buf, buf_size, 0);
  
      if (tmpptr) {
          frame->nb_samples = avctx->frame_size;
 -        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
 -            av_log(avctx, AV_LOG_ERROR, "ff_get_buffer() failed\n");
 +        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
              goto end;
-         memcpy(frame->extended_data[0], tmpptr,
 -        }
+     }
+     if (s->decoder_buffer) {
+         memcpy(frame->extended_data[0], buf,
                 avctx->channels * avctx->frame_size *
                 av_get_bytes_per_sample(avctx->sample_fmt));
+         if (!s->anc_buffer)
+             av_freep(&s->decoder_buffer);
      }
  
      *got_frame_ptr = 1;
@@@ -29,8 -29,8 +29,8 @@@
  #include "libavutil/version.h"
  
  #define LIBAVCODEC_VERSION_MAJOR 56
 -#define LIBAVCODEC_VERSION_MINOR  5
 -#define LIBAVCODEC_VERSION_MICRO  1
 +#define LIBAVCODEC_VERSION_MINOR  8
- #define LIBAVCODEC_VERSION_MICRO 100
++#define LIBAVCODEC_VERSION_MICRO 101
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                 LIBAVCODEC_VERSION_MINOR, \