changeset 6115:98be2e14e5d6 libavcodec

do not set channels before checking request_channels
author jbr
date Sat, 05 Jan 2008 16:47:40 +0000
parents f6b691720c7d
children 4f8fcb40bf2c
files liba52.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liba52.c	Sat Jan 05 16:45:25 2008 +0000
+++ b/liba52.c	Sat Jan 05 16:47:40 2008 +0000
@@ -186,11 +186,12 @@
                     s->channels = ac3_channels[s->flags & 7];
                     if (s->flags & A52_LFE)
                         s->channels++;
-                        avctx->channels = s->channels;
                     if (avctx->request_channels > 0 &&
                             avctx->request_channels <= 2 &&
                             avctx->request_channels < s->channels) {
                         avctx->channels = avctx->request_channels;
+                    } else {
+                        avctx->channels = s->channels;
                     }
                     avctx->bit_rate = bit_rate;
                 }