Fixing the command to control the data stream crash issue.

This commit is contained in:
lixiaobin
2023-12-27 14:48:46 +08:00
parent 884ca95872
commit b25c390cd5
+2
View File
@@ -306,8 +306,10 @@ void OBCameraNode::startStreams() {
throw std::runtime_error("Failed to start pipeline"); throw std::runtime_error("Failed to start pipeline");
} }
if (enable_stream_[COLOR]) { if (enable_stream_[COLOR]) {
if (colorFrameThread_) {
colorFrameThread_ = std::make_shared<std::thread>([this]() { onNewColorFrameCallback(); }); colorFrameThread_ = std::make_shared<std::thread>([this]() { onNewColorFrameCallback(); });
} }
}
if (enable_frame_sync_) { if (enable_frame_sync_) {
pipeline_->enableFrameSync(); pipeline_->enableFrameSync();
} }