1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-10 00:51:13 +02:00

Bug1434 (the crashing part) mixing and rendering a track with gaps

This commit is contained in:
Paul Licameli 2016-07-04 16:52:02 -04:00
parent 4c019a2b03
commit 2e63a0ad37

View File

@ -2798,7 +2798,7 @@ constSamplePtr WaveTrackCache::Get(sampleFormat format,
for (int ii = 0; ii < mNValidBuffers && remaining > 0; ++ii) {
const sampleCount starti = start - mBuffers[ii].start;
const sampleCount leni = std::min(remaining, mBuffers[ii].len - starti);
if (leni == len) {
if (initLen == 0 && leni == len) {
// All is contiguous already. We can completely avoid copying
return samplePtr(mBuffers[ii].data + starti);
}
@ -2818,6 +2818,10 @@ constSamplePtr WaveTrackCache::Get(sampleFormat format,
if (remaining > 0) {
// Very big request!
// Fall back to direct fetch
if (buffer == 0) {
mOverlapBuffer.Resize(len, format);
buffer = mOverlapBuffer.ptr();
}
if (!mPTrack->Get(buffer, format, start, remaining))
return 0;
}