diff --git a/include/core/common/time_stamp.h b/include/core/common/time_stamp.h index 7e17ac4f9e1b44337923c8f19230b11fe2f76ea3..2643f13c8f9629dce921726d6dfacf3171c3417f 100644 --- a/include/core/common/time_stamp.h +++ b/include/core/common/time_stamp.h @@ -290,8 +290,6 @@ inline double TimeStamp::operator -(const TimeStamp& ts) const return double((long int)(time_stamp_nano_ - ts.time_stamp_nano_))*1e-9; // long int cast fix overflow in case of negative substraction result } -//static const TimeStamp TimeStampInvalid() {return TimeStamp(-1.0);} - } // namespace wolf #endif diff --git a/src/common/time_stamp.cpp b/src/common/time_stamp.cpp index 595023484187d36e0bb5c8a6e361beda1ff2f089..0421efa9b06aaf3f2f75796910485aa687217bba 100644 --- a/src/common/time_stamp.cpp +++ b/src/common/time_stamp.cpp @@ -37,7 +37,7 @@ TimeStamp::TimeStamp(const TimeStamp& _ts) : TimeStamp::TimeStamp(const double& _ts) : time_stamp_nano_(_ts > 0 ? (unsigned long int)(_ts*1e9) : 0), - is_valid_(_ts > 0) + is_valid_(_ts >= 0) { // } diff --git a/src/processor/processor_motion.cpp b/src/processor/processor_motion.cpp index 181ea7f662b6c6622112f88d733faafd9417bb61..c403a87828f9266089f63c8e8cb274cb03616729 100644 --- a/src/processor/processor_motion.cpp +++ b/src/processor/processor_motion.cpp @@ -58,6 +58,24 @@ void ProcessorMotion::splitBuffer(const wolf::CaptureMotionPtr& _capture_source, const FrameBasePtr& _keyframe_target, const wolf::CaptureMotionPtr& _capture_target) { + /** we are doing this: + * + * Before split: + * + * ts_split + * KF | F or KF + * * -----------------------* + * origin source + * + * + * After split: + * + * KF KF F or KF + * * ----------* -----------* + * origin target source + * + */ + // split the buffer // and give the part of the buffer before the new keyframe to the capture for the KF callback _capture_source->getBuffer().split(_ts_split, _capture_target->getBuffer());