aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2008-01-05 16:47:40 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2008-01-05 16:47:40 +0000
commit3eca1e6fad56f295fb1ef67cb70aff37ff4936a4 (patch)
tree77128f7a37162a2b4b8bb05d981b533804e5b231
parentdc7009ea1bca3f1a2efe5722e445c153956f6e05 (diff)
downloadffmpeg-3eca1e6fad56f295fb1ef67cb70aff37ff4936a4.tar.gz
do not set channels before checking request_channels
Originally committed as revision 11418 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/liba52.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/liba52.c b/libavcodec/liba52.c
index d8065ef14c..f366a3f5b1 100644
--- a/libavcodec/liba52.c
+++ b/libavcodec/liba52.c
@@ -186,11 +186,12 @@ static int a52_decode_frame(AVCodecContext *avctx,
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;
}