mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 09:01:13 +02:00
Prevent stereo->mono effects from causing a crash.
This commit is contained in:
parent
ffc41f0f10
commit
6868a318d9
@ -1748,9 +1748,16 @@ bool Effect::ProcessTrack(int count,
|
|||||||
// Write them out
|
// Write them out
|
||||||
left->Set((samplePtr) mOutBuffer[0], floatSample, outLeftPos, outputBufferCnt);
|
left->Set((samplePtr) mOutBuffer[0], floatSample, outLeftPos, outputBufferCnt);
|
||||||
if (right)
|
if (right)
|
||||||
|
{
|
||||||
|
if (chans >= 2)
|
||||||
{
|
{
|
||||||
right->Set((samplePtr) mOutBuffer[1], floatSample, outRightPos, outputBufferCnt);
|
right->Set((samplePtr) mOutBuffer[1], floatSample, outRightPos, outputBufferCnt);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
right->Set((samplePtr) mOutBuffer[0], floatSample, outRightPos, outputBufferCnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (isGenerator)
|
else if (isGenerator)
|
||||||
{
|
{
|
||||||
@ -1798,9 +1805,16 @@ bool Effect::ProcessTrack(int count,
|
|||||||
{
|
{
|
||||||
left->Set((samplePtr) mOutBuffer[0], floatSample, outLeftPos, outputBufferCnt);
|
left->Set((samplePtr) mOutBuffer[0], floatSample, outLeftPos, outputBufferCnt);
|
||||||
if (right)
|
if (right)
|
||||||
|
{
|
||||||
|
if (chans >= 2)
|
||||||
{
|
{
|
||||||
right->Set((samplePtr) mOutBuffer[1], floatSample, outRightPos, outputBufferCnt);
|
right->Set((samplePtr) mOutBuffer[1], floatSample, outRightPos, outputBufferCnt);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
right->Set((samplePtr) mOutBuffer[0], floatSample, outRightPos, outputBufferCnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (isGenerator)
|
else if (isGenerator)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user