Skip to content

Commit b13deb0

Browse files
committed
Update Synchronizer.cpp
1 parent 32f3af3 commit b13deb0

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

Source/Processors/Synchronizer/Synchronizer.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ void SyncStream::addEvent (int64 sampleNumber, bool state)
262262

263263
double SyncStream::getLatestSyncTime()
264264
{
265-
//LOGD ("Getting latest sync time for stream ", streamKey, "...");
266-
//LOGD ("Time::currentTimeMillis(): ", Time::currentTimeMillis());
267-
//LOGD ("latestSyncMillis: ", latestSyncMillis);
265+
LOGC ("Getting latest sync time for stream ", streamKey, "...");
266+
LOGC ("Time::currentTimeMillis(): ", Time::currentTimeMillis());
267+
LOGC ("latestSyncMillis: ", latestSyncMillis);
268268

269269

270270
if (latestSyncMillis != -1)
@@ -648,7 +648,7 @@ void SyncStream::syncWithHarp()
648648

649649
if (std::abs (estimatedSampleRate - expectedSampleRate) / expectedSampleRate < 0.05)
650650
{
651-
//LOGD ("Estimated sample rate from Harp barcodes: ", estimatedSampleRate);
651+
LOGC (streamKey, " total barcodes = ", completedBarcodes.size(), "; estimated sample rate: ", estimatedSampleRate);
652652
actualSampleRate = estimatedSampleRate;
653653

654654
// Calculate global start time
@@ -660,9 +660,16 @@ void SyncStream::syncWithHarp()
660660
latestGlobalSyncTime = double(lastBarcode.encodedTime);
661661

662662
isSynchronized = true;
663+
latestSyncMillis = Time::currentTimeMillis();
663664

664665
//LOGD ("Harp stream ", streamKey, " synchronized. Sample rate: ", actualSampleRate, ", start time: ", globalStartTime);
665666
}
667+
else
668+
{
669+
LOGC (streamKey, " estimated sample rate out of range; clearing Harp barcodes.");
670+
isSynchronized = false;
671+
completedBarcodes.clear();
672+
}
666673

667674
}
668675

0 commit comments

Comments
 (0)