diff aac_ac3_parser.c @ 6119:49d225414a3f libavcodec

add downmixing support to libfaad decoder
author jbr
date Sat, 05 Jan 2008 21:08:20 +0000
parents ed3937d4f2aa
children 32b984487899
line wrap: on
line diff
--- a/aac_ac3_parser.c	Sat Jan 05 18:40:49 2008 +0000
+++ b/aac_ac3_parser.c	Sat Jan 05 21:08:20 2008 +0000
@@ -60,11 +60,12 @@
                     s->frame_size = len;
                     /* update codec info */
                     avctx->sample_rate = sample_rate;
-                    /* allow downmixing to mono or stereo for AC3 */
+                    /* allow downmixing to stereo (or mono for AC3) */
                     if(avctx->request_channels > 0 &&
                             avctx->request_channels < channels &&
-                            avctx->request_channels <= 2 &&
-                            avctx->codec_id == CODEC_ID_AC3) {
+                            (avctx->request_channels <= 2 ||
+                            (avctx->request_channels == 1 &&
+                            avctx->codec_id == CODEC_ID_AC3))) {
                         avctx->channels = avctx->request_channels;
                     } else {
                         avctx->channels = channels;