Commit aaac7581 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

Improve Camera::AcqThread::readRecvPackets loop:

* Consider packet block incomplete if becomes 10 frames old
* Ignore packet blocks from old (finished) frames
parent 178a6f52
......@@ -268,6 +268,8 @@ DetFrameImagePackets Camera::AcqThread::readRecvPackets(FrameType frame)
auto stopped = [&]() { return (m_cam->getAcqState() == StopReq); };
const int age_margin = 10;
int nb_recvs = m_cam->getNbRecvs();
for (int i = 0; i < nb_recvs; ++i) {
while ((det_packets.find(i) == det_packets.end()) &&
......@@ -281,10 +283,13 @@ DetFrameImagePackets Camera::AcqThread::readRecvPackets(FrameType frame)
FrameType f = image_packets->frame;
if (f == frame) {
det_packets.emplace(MapEntry(i, image_packets));
break;
} else if (f < frame) {
continue;
} else {
DetImagePackets& other = m_frame_packet_map[f];
other.emplace(MapEntry(i, image_packets));
if (f > frame + age_margin)
break;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment