ref: 586a2b1cac6d1cda1c7787813bd6bb05a25e1992
parent: c289941db2996c6b06bae41762c01f4608c108ab
author: menno <menno>
date: Tue May 16 11:13:23 EDT 2000
First go at multichannel support (not working at all, yet)
--- a/encoder.c
+++ b/encoder.c
@@ -221,11 +221,12 @@
while(samplesOut >= 1024*as->channels) {
// Process Buffer
if (as->sampleBuffer) {
- if (as->channels == 2) {
+// if (as->channels == 2) {
if (Samples > 0)
for (i = 0; i < 1024; i++) {
- as->inputBuffer[0][i] = data[curSample+(i*2)];
- as->inputBuffer[1][i] = data[curSample+(i*2)+1];
+// as->inputBuffer[0][i] = data[curSample+(i*as->channels)];
+ for (j = 0; j < as->channels; j++)
+ as->inputBuffer[j][i] = data[curSample+(i*as->channels)+j];
}
else // (Samples == 0) when called by faacEncodeFinish
for (i = 0; i < 1024; i++) {
@@ -232,12 +233,12 @@
as->inputBuffer[0][i] = 0;
as->inputBuffer[1][i] = 0;
}
- }
- else {
+// }
+// else {
// No mono supported yet (basically only a problem with decoder
// the encoder in fact supports it).
- return FERROR;
- }
+// return FERROR;
+// }
}
if (as->is_first_frame) {