Merge commit '205a95f7b5178362874bc1e65eae9866723491c1'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 13 Feb 2013 11:49:48 +0000 (12:49 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 13 Feb 2013 11:49:48 +0000 (12:49 +0100)
* commit '205a95f7b5178362874bc1e65eae9866723491c1':
  wmaenc: alloc/free coded_frame instead of keeping it in the WMACodecContext
  wma: decode directly to the user-provided AVFrame
  wmapro: decode directly to the user-provided AVFrame
  wavpack: decode directly to the user-provided AVFrame

Conflicts:
libavcodec/wavpack.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/wavpack.c
libavcodec/wma.c
libavcodec/wma.h
libavcodec/wmadec.c
libavcodec/wmaenc.c
libavcodec/wmaprodec.c

@@@ -1218,12 -1204,11 +1215,12 @@@ static int wavpack_decode_frame(AVCodec
      }
  
      /* get output buffer */
-     s->frame.nb_samples = s->samples + 1;
-     if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
 -    frame->nb_samples = s->samples;
++    frame->nb_samples = s->samples + 1;
+     if ((ret = ff_get_buffer(avctx, frame)) < 0) {
          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
          return ret;
      }
-     s->frame.nb_samples = s->samples;
++    frame->nb_samples = s->samples;
  
      while (buf_size > 0) {
          if (!s->multichannel) {
              av_log(avctx, AV_LOG_ERROR, "Block %d has invalid size (size %d "
                     "vs. %d bytes left)\n", s->block, frame_size, buf_size);
              wavpack_decode_flush(avctx);
 -            return -1;
 +            return AVERROR_INVALIDDATA;
          }
          if ((samplecount = wavpack_decode_block(avctx, s->block,
-                                                 s->frame.data[0], got_frame_ptr,
+                                                 frame->data[0], got_frame_ptr,
                                                  buf, frame_size)) < 0) {
              wavpack_decode_flush(avctx);
 -            return -1;
 +            return AVERROR_INVALIDDATA;
          }
          s->block++;
          buf += frame_size; buf_size -= frame_size;
Simple merge
Simple merge
@@@ -918,10 -903,9 +916,9 @@@ static int wma_decode_superframe(AVCode
              s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len,
              (int8_t *)samples - (int8_t *)data, avctx->block_align);
  
-     *got_frame_ptr   = 1;
-     *(AVFrame *)data = s->frame;
+     *got_frame_ptr = 1;
  
 -    return avctx->block_align;
 +    return buf_size;
   fail:
      /* when error, we reset the bit reservoir */
      s->last_superframe_len = 0;
@@@ -82,14 -89,10 +87,9 @@@ static int encode_init(AVCodecContext 
                           (avctx->sample_rate * 8);
      block_align        = FFMIN(block_align, MAX_CODED_SUPERFRAME_SIZE);
      avctx->block_align = block_align;
 -    avctx->bit_rate    = avctx->block_align * 8LL * avctx->sample_rate /
 -                         s->frame_len;
 +
      avctx->frame_size = avctx->delay = s->frame_len;
  
- #if FF_API_OLD_ENCODE_AUDIO
-     avctx->coded_frame = &s->frame;
-     avcodec_get_frame_defaults(avctx->coded_frame);
- #endif
      return 0;
  }
  
Simple merge