Skip to content

Commit a3719d9

Browse files
committed
Restore buffers on kwik file close
1 parent bede44c commit a3719d9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Source/Plugins/KWIKFormat/RecordEngine/HDF5Recording.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,14 @@ void HDF5Recording::closeFiles()
186186
recordedChanToKWDChan.clear();
187187
channelTimestampArray.clear();
188188
channelLeftOverSamples.clear();
189+
scaledBuffer.malloc(MAX_BUFFER_SIZE);
190+
intBuffer.malloc(MAX_BUFFER_SIZE);
191+
bufferSize = MAX_BUFFER_SIZE;
189192
}
190193

191194
void HDF5Recording::writeData(int writeChannel, int realChannel, const float* buffer, int size)
192195
{
193-
if (size > bufferSize) //Shouldn't happen, and if it happens it'll be slow, but better this than crashing. Will be reset on reset.
196+
if (size > bufferSize) //Shouldn't happen, and if it happens it'll be slow, but better this than crashing. Will be reset on flie close and reset.
194197
{
195198
std::cerr << "Write buffer overrun, resizing to" << size << std::endl;
196199
bufferSize = size;

0 commit comments

Comments
 (0)