Skip to content

Commit a386ac0

Browse files
committed
Fix timestamps in binary format
1 parent 483f7f3 commit a386ac0

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Source/Plugins/BinaryWriter/BinaryRecording.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,16 @@ void BinaryRecording::writeData(int writeChannel, int realChannel, const float*
501501

502502
m_DataFiles[m_fileIndexes[writeChannel]]->writeChannel(getTimestamp(writeChannel)-m_startTS[writeChannel],m_channelIndexes[writeChannel],m_intBuffer.getData(),size);
503503

504-
int64 baseTS = getTimestamp(writeChannel);
505-
//Let's hope that the compiler is smart enough to vectorize this.
506-
for (int i = 0; i < size; i++)
504+
if (m_channelIndexes[writeChannel] == 0)
507505
{
508-
m_tsBuffer[i] = (baseTS + i);
506+
int64 baseTS = getTimestamp(writeChannel);
507+
//Let's hope that the compiler is smart enough to vectorize this.
508+
for (int i = 0; i < size; i++)
509+
{
510+
m_tsBuffer[i] = (baseTS + i);
511+
}
512+
m_dataTimestampFiles[m_fileIndexes[writeChannel]]->writeData(m_tsBuffer, size*sizeof(int64));
509513
}
510-
m_dataTimestampFiles[m_fileIndexes[writeChannel]]->writeData(m_tsBuffer, size*sizeof(int64));
511514
}
512515

513516

0 commit comments

Comments
 (0)