Merge commit 'f13ffb6636fdecb5e3e0ddcff48f096e7b3db362'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 28 May 2014 10:09:42 +0000 (12:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 28 May 2014 10:20:12 +0000 (12:20 +0200)
* commit 'f13ffb6636fdecb5e3e0ddcff48f096e7b3db362':
  flacdec: do not overwrite a channel layout set by the caller

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

@@@ -225,9 -225,13 +225,12 @@@ void avpriv_flac_parse_streaminfo(AVCod
      avctx->channels = s->channels;
      avctx->sample_rate = s->samplerate;
      avctx->bits_per_raw_sample = s->bps;
-     ff_flac_set_channel_layout(avctx);
+     if (!avctx->channel_layout ||
+         av_get_channel_layout_nb_channels(avctx->channel_layout) != avctx->channels)
+         ff_flac_set_channel_layout(avctx);
  
 -    s->samples  = get_bits_long(&gb, 32) << 4;
 -    s->samples |= get_bits(&gb, 4);
 +    s->samples = get_bits64(&gb, 36);
  
      skip_bits_long(&gb, 64); /* md5 sum */
      skip_bits_long(&gb, 64); /* md5 sum */