Fix AAC mono decode (#297)

As noted by Marc Madaule (thanks!), the mono AAC decode was not
functioning properly.  Adjust the output stuff loop to fix.
This commit is contained in:
Earle F. Philhower, III authored and GitHub committed 2020-08-15 21:05:12 -07:00
1 parent 197b7fe794
commit cdf71d6bcf
1 file changed
+7 -2
+7 -2
View File
@@ -144,8 +144,13 @@ bool AudioGeneratorAAC::loop()
// If we've got data, try and pump it out...
while (validSamples) {
lastSample[0] = outSample[curSample*2];
lastSample[1] = outSample[curSample*2 + 1];
if (lastChannels == 1) {
lastSample[0] = outSample[curSample];
lastSample[1] = outSample[curSample];
} else {
lastSample[0] = outSample[curSample*2];
lastSample[1] = outSample[curSample*2 + 1];
}
if (!output->ConsumeSample(lastSample)) goto done; // Can't send, but no error detected
validSamples--;
curSample++;