mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 17:19:43 +02:00
As mentioned in commit message for 12574, here is one example of a routine
that was doing extra processing because Dither couldn't return interleaved buffers.
This commit is contained in:
parent
a3d27b135b
commit
7ddd4ed2ab
@ -3217,25 +3217,19 @@ static void DoSoftwarePlaythrough(const void *inputBuffer,
|
|||||||
float *outputBuffer,
|
float *outputBuffer,
|
||||||
int len)
|
int len)
|
||||||
{
|
{
|
||||||
float *tempBuffer = (float *)alloca(len * sizeof(float));
|
for (int i=0; i < inputChannels; i++) {
|
||||||
int i, j;
|
samplePtr inputPtr = ((samplePtr)inputBuffer) + (i * SAMPLE_SIZE(inputFormat));
|
||||||
|
samplePtr outputPtr = ((samplePtr)outputBuffer) + (i * SAMPLE_SIZE(floatSample));
|
||||||
for(j=0; j<inputChannels; j++) {
|
|
||||||
samplePtr inputPtr = ((samplePtr)inputBuffer) + (j * SAMPLE_SIZE(inputFormat));
|
|
||||||
|
|
||||||
CopySamples(inputPtr, inputFormat,
|
CopySamples(inputPtr, inputFormat,
|
||||||
(samplePtr)tempBuffer, floatSample,
|
(samplePtr)outputPtr, floatSample,
|
||||||
len, true, inputChannels);
|
len, true, inputChannels, 2);
|
||||||
|
}
|
||||||
for(i=0; i<len; i++)
|
|
||||||
outputBuffer[2*i + (j%2)] = tempBuffer[i];
|
|
||||||
|
|
||||||
// One mono input channel goes to both output channels...
|
// One mono input channel goes to both output channels...
|
||||||
if (inputChannels == 1)
|
if (inputChannels == 1)
|
||||||
for(i=0; i<len; i++)
|
for (int i=0; i < len; i++)
|
||||||
outputBuffer[2*i + 1] = tempBuffer[i];
|
outputBuffer[2*i + 1] = outputBuffer[2*i];
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
|
int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user