mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
WASAPI: Fix bug where attempting to clear output buffers had no effect
This commit is contained in:
parent
4045b0f8f6
commit
dcf0bf1c2a
1 changed files with 4 additions and 6 deletions
|
|
@ -1529,8 +1529,6 @@ public:
|
|||
|
||||
AudioBuffer<float> ins (jmax (1, numInputBuffers), bufferSize + 32);
|
||||
AudioBuffer<float> outs (jmax (1, numOutputBuffers), bufferSize + 32);
|
||||
auto inputBuffers = ins.getArrayOfWritePointers();
|
||||
auto outputBuffers = outs.getArrayOfWritePointers();
|
||||
ins.clear();
|
||||
outs.clear();
|
||||
|
||||
|
|
@ -1569,7 +1567,7 @@ public:
|
|||
inputDevice->handleDeviceBuffer();
|
||||
}
|
||||
|
||||
inputDevice->copyBuffersFromReservoir (inputBuffers, numInputBuffers, bufferSize);
|
||||
inputDevice->copyBuffersFromReservoir (ins.getArrayOfWritePointers(), numInputBuffers, bufferSize);
|
||||
|
||||
if (inputDevice->sampleRateHasChanged)
|
||||
{
|
||||
|
|
@ -1585,9 +1583,9 @@ public:
|
|||
|
||||
if (sl.isLocked() && (flags & flagStarted) != 0)
|
||||
{
|
||||
callback->audioDeviceIOCallbackWithContext (inputBuffers,
|
||||
callback->audioDeviceIOCallbackWithContext (ins.getArrayOfReadPointers(),
|
||||
numInputBuffers,
|
||||
outputBuffers,
|
||||
outs.getArrayOfWritePointers(),
|
||||
numOutputBuffers,
|
||||
bufferSize,
|
||||
{});
|
||||
|
|
@ -1602,7 +1600,7 @@ public:
|
|||
{
|
||||
// Note that this function is handed the input device so it can check for the event and make sure
|
||||
// the input reservoir is filled up correctly even when bufferSize > device actualBufferSize
|
||||
outputDevice->copyBuffers (outputBuffers, numOutputBuffers, bufferSize, inputDevice.get(), *this);
|
||||
outputDevice->copyBuffers (outs.getArrayOfReadPointers(), numOutputBuffers, bufferSize, inputDevice.get(), *this);
|
||||
|
||||
if (outputDevice->sampleRateHasChanged)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue