Check for empty buffer

This commit is contained in:
oparviai 2009-02-27 17:24:42 +00:00
parent 47659b0810
commit f1a9f40da0

View File

@ -179,7 +179,10 @@ void FIFOSampleBuffer::ensureCapacity(uint capacityRequirement)
} }
// Align the buffer to begin at 16byte cache line boundary for optimal performance // Align the buffer to begin at 16byte cache line boundary for optimal performance
temp = (SAMPLETYPE *)(((ulong)tempUnaligned + 15) & (ulong)-16); temp = (SAMPLETYPE *)(((ulong)tempUnaligned + 15) & (ulong)-16);
if (samplesInBuffer)
{
memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE)); memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE));
}
delete[] bufferUnaligned; delete[] bufferUnaligned;
buffer = temp; buffer = temp;
bufferUnaligned = tempUnaligned; bufferUnaligned = tempUnaligned;