1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-28 14:18:41 +02:00

Bug 1863: Windows crash when resampling in WASAPI

Problem: soxr_process doesn't like being called with length of buffers equal to zero.

Fix: don't call it, when this is the case.
This commit is contained in:
David Bailes 2018-05-22 11:34:12 +01:00
parent 318967f00d
commit a22be24ae3

View File

@ -4064,13 +4064,15 @@ void AudioIO::FillBuffers()
* must flush any samples left in the rate conversion buffer
* so that they get recorded
*/
const auto results =
mResample[i]->Process(mFactor, (float *)temp1.ptr(), avail,
!IsStreamActive(), (float *)temp2.ptr(), size);
size = results.second;
// see comment in second handler about guarantee
mCaptureTracks[i]-> Append(temp2.ptr(), floatSample, size, 1,
&appendLog);
if (avail > 0 ) {
const auto results =
mResample[i]->Process(mFactor, (float *)temp1.ptr(), avail,
!IsStreamActive(), (float *)temp2.ptr(), size);
size = results.second;
// see comment in second handler about guarantee
mCaptureTracks[i]-> Append(temp2.ptr(), floatSample, size, 1,
&appendLog);
}
}
if (!appendLog.IsEmpty())