Commit 39e26da3 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

CheckLostPackets: ensure that port frame array is stable before checking

parent b5b704a7
......@@ -411,6 +411,7 @@ private:
double m_new_frame_timeout;
double m_abort_sleep_time;
bool m_tol_lost_packets;
FrameArray m_prev_ifa;
std::vector<PortStats> m_port_stats;
TimeRangesChangedCallback *m_time_ranges_cb;
PixelDepthCPUAffinityMap m_cpu_affinity_map;
......
......@@ -964,6 +964,7 @@ void Camera::prepareAcq()
AutoMutex l = lock();
m_frame_map.setBufferSize(nb_buffers);
m_frame_map.clear();
m_prev_ifa.clear();
DEB_TRACE() << DEB_VAR1(m_frame_queue.size());
while (!m_frame_queue.empty())
m_frame_queue.pop();
......@@ -1050,6 +1051,11 @@ bool Camera::checkLostPackets()
DEB_MEMBER_FUNCT();
FrameArray ifa = m_frame_map.getItemFrameArray();
if (ifa != m_prev_ifa) {
m_prev_ifa = ifa;
return false;
}
FrameType last_frame = getLatestFrame(ifa);
if (getOldestFrame(ifa) == last_frame) {
DEB_RETURN() << DEB_VAR1(false);
......
Supports Markdown
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