# HG changeset patch # User michael # Date 1083209614 0 # Node ID d9e067853051741245a65571a06c0948fadb047d # Parent c8e866f4515f29ecdb32347cce6b0cf1a4667bd3 >2 channels decoding fix diff -r c8e866f4515f -r d9e067853051 parser.c --- a/parser.c Tue Apr 27 13:50:41 2004 +0000 +++ b/parser.c Thu Apr 29 03:33:34 2004 +0000 @@ -877,9 +877,12 @@ s->frame_size = len; /* update codec info */ avctx->sample_rate = sample_rate; - avctx->channels = ac3_channels[s->flags & 7]; - if (s->flags & A52_LFE) - avctx->channels++; + /* set channels,except if the user explicitly requests 1 or 2 channels, XXX/FIXME this is a bit ugly */ + if(avctx->channels!=1 && avctx->channels!=2){ + avctx->channels = ac3_channels[s->flags & 7]; + if (s->flags & A52_LFE) + avctx->channels++; + } avctx->bit_rate = bit_rate; avctx->frame_size = 6 * 256; }