From a0a9742b6f4f41b00bf238c0b3506c98b1206e59 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 11 Jul 2008 23:29:15 +0000 Subject: [PATCH] Fix attempt for 1399; if it doesn't completely correct the multichannel corruption problem (encoder only), then it is a necessary part of the fix. (The encoder was accidentally collapsing the redidue bundle to remove silent residues twice, potentiall causing corruption the second time if a preceeding channel was silent) svn path=/trunk/vorbis/; revision=15110 --- lib/mapping0.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/mapping0.c b/lib/mapping0.c index 912b754..74b19b7 100644 --- a/lib/mapping0.c +++ b/lib/mapping0.c @@ -722,7 +722,15 @@ static int mapping0_forward(vorbis_block *vb){ classifications=_residue_P[ci->residue_type[resnum]]-> class(vb,b->residue[resnum],couple_bundle,zerobundle,ch_in_bundle); - + + /* couple_bundle is destructively overwritten by + the class function if some but not all of the channels are + marked as silence; build a fresh copy */ + ch_in_bundle=0; + for(j=0;jchannels;j++) + if(info->chmuxlist[j]==i) + couple_bundle[ch_in_bundle++]=vb->pcm[j]+n/2; + _residue_P[ci->residue_type[resnum]]-> forward(opb,vb,b->residue[resnum], couple_bundle,NULL,zerobundle,ch_in_bundle,classifications); -- 2.7.4