Is it me or the copy constructor of AudioSampleBuffer ( AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer & other)) used in a processBlock method doesn't copy the data anymore (since a couple of juce modules versions) ?
More precisely, it seems to be because "allocateBytes" is 0
/** Copies another buffer.
This buffer will make its own copy of the other's data, unless the buffer was created
using an external data buffer, in which case boths buffers will just point to the same
shared block of data.
*/
AudioSampleBuffer (const AudioSampleBuffer& other) noexcept;
I'm not sure I understand the logic behind the "new" behaviour... I found it very convenient to just be able to write
AudioSampleBuffer B = A;
to create an independent copy of A, where A was, for instance, the buffer given to me in processBlock. Now, depending on how A was created (how am I supposed to know this? ) this may or may not create merely a reference to A. Moreover, if I write
AudioSampleBuffer B;
B = A;
I get a different result. I know, I know, copy constructor vs. assignment constructor etc., but this seems to have the potential for a lot of confusion... I'd expect the copy of a buffer to always have its own channel data.