aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dca.c
diff options
context:
space:
mode:
authorAndreas Öman <andreas@lonelycoder.com>2007-12-15 07:01:33 +0000
committerAndreas Öman <andreas@lonelycoder.com>2007-12-15 07:01:33 +0000
commit79328e9cc7bcfb59091acfc144b5566dd0357675 (patch)
treed56c52d05b2d9534b86255b1ade62e28b53b9184 /libavcodec/dca.c
parent6708eefe558eb8c307c5bca00083bf4c406dd600 (diff)
downloadffmpeg-79328e9cc7bcfb59091acfc144b5566dd0357675.tar.gz
Make DCA decoder honor avctx->request_channels in a more advisory way.
Originally committed as revision 11221 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r--libavcodec/dca.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index c237cc9a50..13eb8652c6 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -1159,23 +1159,12 @@ static int dca_decode_frame(AVCodecContext * avctx,
avctx->bit_rate = s->bit_rate;
channels = s->prim_channels + !!s->lfe;
- avctx->channels = avctx->request_channels;
- if(avctx->channels == 0) {
- avctx->channels = channels;
- } else if(channels < avctx->channels) {
- av_log(avctx, AV_LOG_WARNING, "DTS source channels are less than "
- "specified: output to %d channels.\n", channels);
- avctx->channels = channels;
- }
- if(avctx->channels == 2) {
+ if(avctx->request_channels == 2 && s->prim_channels > 2) {
+ channels = 2;
s->output = DCA_STEREO;
- } else if(avctx->channels != channels) {
- av_log(avctx, AV_LOG_ERROR, "Cannot downmix DTS to %d channels.\n",
- avctx->channels);
- return -1;
}
- channels = avctx->channels;
+ avctx->channels = channels;
if(*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * channels)
return -1;
*data_size = 0;