diff --git a/src/processor/processor_motion.cpp b/src/processor/processor_motion.cpp index 02b975499940b2e01d0e477f843d8d2b496a1fda..a33fcde2cac2a04d149f759e1e1ad08c574c041e 100644 --- a/src/processor/processor_motion.cpp +++ b/src/processor/processor_motion.cpp @@ -96,7 +96,6 @@ void ProcessorMotion::process(CaptureBasePtr _incoming_ptr) switch(processing_step_) { - case RUNNING_WITHOUT_PACK : case RUNNING_WITH_PACK_ON_ORIGIN : break; @@ -658,6 +657,10 @@ PackKeyFramePtr ProcessorMotion::computeProcessingStep() PackKeyFramePtr pack = buffer_pack_kf_.selectFirstPackBefore(last_ptr_, params_motion_->time_tolerance); + // ignore "future" KF to avoid MotionBuffer::split() error + if (pack && pack->key_frame->getTimeStamp() > last_ptr_->getBuffer().get().back().ts_) + pack = nullptr; + if (pack) { if (buffer_pack_kf_.checkTimeTolerance(pack->key_frame->getTimeStamp(), pack->time_tolerance, origin_ptr_->getTimeStamp(), params_motion_->time_tolerance))