Cog Audio: Fix generic upmixer mode
This resulted in horrible things, the generic N to N upmixer was leaving unmapped channels as uninitialized memory. This fixes horrible things happening for people with interfaces with more channels than the source file, frequently when the source file is stereo, or if the file is mono and a center channel is present. Signed-off-by: Christopher Snowhill <kode54@gmail.com>CQTexperiment
parent
e2e83ea760
commit
b1a98139cb
|
@ -295,6 +295,7 @@ static void upmix(const float *inBuffer, int inchannels, uint32_t inconfig, floa
|
|||
}
|
||||
for(size_t i = 0; i < count; ++i) {
|
||||
// upmix N channels to N channels plus silence the empty channels
|
||||
memset(outBuffer + i * outchannels, 0, sizeof(float) * outchannels);
|
||||
for(int j = 0; j < inchannels; ++j) {
|
||||
if(outIndexes[j] != ~0) {
|
||||
outBuffer[i * outchannels + outIndexes[j]] = inBuffer[i * inchannels + j];
|
||||
|
|
Loading…
Reference in New Issue