flac: don't check the number of channels before setting the channel layout
authorTim Walker <tdskywalker@gmail.com>
Thu, 7 Feb 2013 09:36:21 +0000 (09:36 +0000)
committerPaul B Mahol <onemda@gmail.com>
Thu, 7 Feb 2013 09:36:21 +0000 (09:36 +0000)
This is unnecessary, as ff_flac_set_channel_layout can handle any number of channels.

libavcodec/flac_parser.c
libavcodec/flacdec.c

index 52ec1ee..e2c6744 100644 (file)
@@ -458,7 +458,7 @@ static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
     }
 
     if (header->fi.channels != fpc->avctx->channels ||
-        (!fpc->avctx->channel_layout && header->fi.channels <= 6)) {
+        !fpc->avctx->channel_layout) {
         fpc->avctx->channels = header->fi.channels;
         ff_flac_set_channel_layout(fpc->avctx);
     }
index 0e887e6..5624972 100644 (file)
@@ -424,7 +424,7 @@ static int decode_frame(FLACContext *s)
             return ret;
     }
     s->channels = s->avctx->channels = fi.channels;
-    if (!s->avctx->channel_layout && s->channels <= 6)
+    if (!s->avctx->channel_layout)
         ff_flac_set_channel_layout(s->avctx);
     s->ch_mode = fi.ch_mode;