Merge commit '7d039e70a5ff23a7deaa866684d2e8872acc5169'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 29 May 2013 02:37:53 +0000 (04:37 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 29 May 2013 02:37:58 +0000 (04:37 +0200)
* commit '7d039e70a5ff23a7deaa866684d2e8872acc5169':
  wavpack: extract channel information from the bitstream

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/wavpack.c

@@@ -1122,8 -1101,19 +1112,19 @@@ static int wavpack_decode_block(AVCodec
          } else
              avctx->sample_rate = wv_rates[sr];
  
+         if (multiblock) {
+             if (chan)
+                 avctx->channels = chan;
+             if (chmask)
+                 avctx->channel_layout = chmask;
+         } else {
+             avctx->channels       = s->stereo ? 2 : 1;
+             avctx->channel_layout = s->stereo ? AV_CH_LAYOUT_STEREO :
+                                                 AV_CH_LAYOUT_MONO;
+         }
          /* get output buffer */
 -        frame->nb_samples = s->samples;
 +        frame->nb_samples = s->samples + 1;
          if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
              av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
              return ret;