comparison aac_ac3_parser.c @ 6110:356a3c897bd2 libavcodec

adjust output channels based on AVCodecContext.request_channels in AC3 parser
author jbr
date Sat, 05 Jan 2008 05:36:00 +0000
parents d6c599061072
children ed3937d4f2aa
comparison
equal deleted inserted replaced
6109:c8b9b73b979f 6110:356a3c897bd2
59 } else { 59 } else {
60 s->frame_size = len; 60 s->frame_size = len;
61 /* update codec info */ 61 /* update codec info */
62 avctx->sample_rate = sample_rate; 62 avctx->sample_rate = sample_rate;
63 avctx->channels = channels; 63 avctx->channels = channels;
64 /* allow downmixing to mono or stereo for AC3 */
65 if(avctx->request_channels > 0 &&
66 avctx->request_channels < channels &&
67 avctx->request_channels <= 2 &&
68 avctx->codec_id == CODEC_ID_AC3) {
69 avctx->channels = avctx->request_channels;
70 }
64 avctx->bit_rate = bit_rate; 71 avctx->bit_rate = bit_rate;
65 avctx->frame_size = samples; 72 avctx->frame_size = samples;
66 } 73 }
67 } 74 }
68 } else { 75 } else {