From eb158e8db3600679e23bd0f6fc943ea72a0f6b1b Mon Sep 17 00:00:00 2001 From: hzcyf <1591563365@qq.com> Date: Wed, 28 Aug 2024 17:15:09 +0800 Subject: [PATCH] Fix log output on sensor state update. --- src/device/component/sensor/SensorBase.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/device/component/sensor/SensorBase.cpp b/src/device/component/sensor/SensorBase.cpp index c268f62f..cfc14b1b 100644 --- a/src/device/component/sensor/SensorBase.cpp +++ b/src/device/component/sensor/SensorBase.cpp @@ -153,6 +153,8 @@ void SensorBase::updateStreamState(OBStreamState state) { globalTimestampCalculator_->clear(); } } + } + if(oldState != state) { LOG_DEBUG("Stream state changed to {}@{}", STREAM_STATE_STR(state), sensorType_); } streamStateCv_.notify_all(); @@ -248,10 +250,10 @@ void SensorBase::outputFrame(std::shared_ptr frame) { } if(frameTimestampCalculator_) { - TRY_EXECUTE(frameTimestampCalculator_->calculate(frame)); + TRY_EXECUTE(frameTimestampCalculator_->calculate(frame)); } if(globalTimestampCalculator_) { - TRY_EXECUTE(globalTimestampCalculator_->calculate(frame)); + TRY_EXECUTE(globalTimestampCalculator_->calculate(frame)); } frameCallback_(frame);