···122122 */
123123 pthread_mutex_unlock(&q->mutex);
124124125125+ /*
126126+ * Average the timestamps, SLAM systems break if they don't have the exact same timestamp.
127127+ * (This is dumb, because on DepthAI the images *are* taken like 0.1ms apart, and we *could* expose
128128+ * that, but oh well.)
129129+ */
130130+131131+ int64_t ts_1 = frames[0]->timestamp;
132132+ int64_t ts_2 = frames[1]->timestamp;
133133+134134+ int64_t diff = (ts_2 - ts_1);
135135+136136+ int64_t ts = ts_1 + (diff / 2);
137137+138138+ frames[0]->timestamp = ts;
139139+ frames[1]->timestamp = ts;
125140126141 // Send to the consumer, in left-right order.
127142 xrt_sink_push_frame(q->consumer_left, frames[0]);