diff --git a/receiver/FPGAImagePuller.cpp b/receiver/FPGAImagePuller.cpp index 26eacc4c0..5d0d884a4 100644 --- a/receiver/FPGAImagePuller.cpp +++ b/receiver/FPGAImagePuller.cpp @@ -147,7 +147,8 @@ void FPGAImagePuller::WaitForFrame(uint16_t data_stream, uint16_t module_number, // A frame is complete once the module is two further on, as in JFJochReceiverFPGA if ((static_cast(counters.GetCurrFrameNumber(module_number)) >= frame + 2) || counters.IsAcquisitionFinished() || failed - || (!blocking && (FastestFrame() >= frame + 2 + MissingAfterFrames))) + || (!blocking && (static_cast(counters.GetFastestFrameNumber()) >= frame + 2 + MissingAfterFrames)) + || (!blocking && (FastestFrame() >= frame + 2 + static_cast(max_slots)))) return; std::this_thread::sleep_for(std::chrono::milliseconds(1)); } diff --git a/receiver/FPGAImagePuller.h b/receiver/FPGAImagePuller.h index 844a839f5..d5d90a16e 100644 --- a/receiver/FPGAImagePuller.h +++ b/receiver/FPGAImagePuller.h @@ -24,7 +24,9 @@ class FPGAImagePuller : public ImagePuller { public: static constexpr size_t DefaultSlots = 128; - // A module this far behind the fastest one is taken as missing from that frame, as the device itself does + // A module this far behind the fastest one of its card is taken as missing from that frame, as the device itself + // does. Behind another card it is waited for as long as the slots can hold the images started meanwhile: the + // cards run on their own and one can be ahead, but past max_slots its images would be dropped anyway. static constexpr int64_t MissingAfterFrames = AcquisitionCounters::ThresholdFramesLost + 2; private: struct Slot {