mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-06 07:29:07 +02:00
Bug2536: crash on Mac sometimes playing back with resampling...
... Intermittent crash, depending on some accidents of memory page allocations, known to happen sometimes when playing a 44100 Hz track at 32000 Hz; the strange story is in the code comments
This commit is contained in:
parent
6dea5434a6
commit
0945b6b734
10
src/Mix.cpp
10
src/Mix.cpp
@ -285,7 +285,8 @@ Mixer::Mixer(const WaveTrackConstArray &inputTracks,
|
|||||||
mBuffer[c].Allocate(mInterleavedBufferSize, mFormat);
|
mBuffer[c].Allocate(mInterleavedBufferSize, mFormat);
|
||||||
mTemp[c].Allocate(mInterleavedBufferSize, floatSample);
|
mTemp[c].Allocate(mInterleavedBufferSize, floatSample);
|
||||||
}
|
}
|
||||||
mFloatBuffer = Floats{ mInterleavedBufferSize };
|
// PRL: Bug2536: see other comments below
|
||||||
|
mFloatBuffer = Floats{ mInterleavedBufferSize + 1 };
|
||||||
|
|
||||||
// But cut the queue into blocks of this finer size
|
// But cut the queue into blocks of this finer size
|
||||||
// for variable rate resampling. Each block is resampled at some
|
// for variable rate resampling. Each block is resampled at some
|
||||||
@ -514,6 +515,13 @@ size_t Mixer::MixVariableRates(int *channelFlags, WaveTrackCache &cache,
|
|||||||
&queue[*queueStart],
|
&queue[*queueStart],
|
||||||
thisProcessLen,
|
thisProcessLen,
|
||||||
last,
|
last,
|
||||||
|
// PRL: Bug2536: crash in soxr happened on Mac, sometimes, when
|
||||||
|
// mMaxOut - out == 1 and &mFloatBuffer[out + 1] was an unmapped
|
||||||
|
// address, because soxr, strangely, fetched an 8-byte (misaligned!)
|
||||||
|
// value from &mFloatBuffer[out], but did nothing with it anyway,
|
||||||
|
// in soxr_output_no_callback.
|
||||||
|
// Now we make the bug go away by allocating a little more space in
|
||||||
|
// the buffer than we need.
|
||||||
&mFloatBuffer[out],
|
&mFloatBuffer[out],
|
||||||
mMaxOut - out);
|
mMaxOut - out);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user