[FFmpeg-cvslog] r11417 - trunk/libavcodec/liba52.c
jbr
subversion
Sat Jan 5 17:45:25 CET 2008
Author: jbr
Date: Sat Jan 5 17:45:25 2008
New Revision: 11417
Log:
use request_channels in liba52 decoder
Modified:
trunk/libavcodec/liba52.c
Modified: trunk/libavcodec/liba52.c
==============================================================================
--- trunk/libavcodec/liba52.c (original)
+++ trunk/libavcodec/liba52.c Sat Jan 5 17:45:25 2008
@@ -117,6 +117,13 @@ static int a52_decode_init(AVCodecContex
s->inbuf_ptr = s->inbuf;
s->frame_size = 0;
+ /* 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;
}
@@ -179,12 +186,11 @@ static int a52_decode_frame(AVCodecConte
s->channels = ac3_channels[s->flags & 7];
if (s->flags & A52_LFE)
s->channels++;
- if (avctx->channels == 0)
- /* No specific number of channel requested */
- avctx->channels = s->channels;
- else if (s->channels < avctx->channels) {
- av_log(avctx, AV_LOG_ERROR, "ac3dec: AC3 Source channels are less than specified: output to %d channels.. (frmsize: %d)\n", s->channels, len);
avctx->channels = s->channels;
+ if (avctx->request_channels > 0 &&
+ avctx->request_channels <= 2 &&
+ avctx->request_channels < s->channels) {
+ avctx->channels = avctx->request_channels;
}
avctx->bit_rate = bit_rate;
}
More information about the ffmpeg-cvslog
mailing list