Browse Source

check for request_channels at codec init

Originally committed as revision 11415 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Justin Ruggles 17 years ago
parent
commit
95283c1701
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavcodec/ac3dec.c

+ 7
- 0
libavcodec/ac3dec.c View File

@@ -312,6 +312,13 @@ static int ac3_decode_init(AVCodecContext *avctx)
s->mul_bias = 32767.0f;
}

/* allow downmixing to stereo or mono */
if (avctx->channels > 0 && avctx->request_channels > 0 &&
avctx->request_channels < avctx->channels &&
avctx->request_channels <= 2) {
avctx->channels = avctx->request_channels;
}

return 0;
}



Loading…
Cancel
Save