From acb4f536833ba517b12510aaa458e77e50ec6f12 Mon Sep 17 00:00:00 2001 From: Avi Saranga Date: Mon, 23 Jul 2018 18:51:12 -0700 Subject: [PATCH] change directory creation logic --- .../implementation/objects/TelmateFrameGrabberOpenCVImpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/src/server/implementation/objects/TelmateFrameGrabberOpenCVImpl.cpp b/module/src/server/implementation/objects/TelmateFrameGrabberOpenCVImpl.cpp index 2429f00..cc099e2 100644 --- a/module/src/server/implementation/objects/TelmateFrameGrabberOpenCVImpl.cpp +++ b/module/src/server/implementation/objects/TelmateFrameGrabberOpenCVImpl.cpp @@ -23,6 +23,7 @@ TelmateFrameGrabberOpenCVImpl::TelmateFrameGrabberOpenCVImpl() { this->snapInterval = 1000; this->epName = "EP_NAME_UNINITIALIZED"; this->storagePath = "/tmp/"; + this->prevStoragePath = this->storagePath; this->framesCounter = 0; this->outputFormat = FGFMT_JPEG; this->lastQueueTimeStamp = 0; @@ -130,7 +131,7 @@ void TelmateFrameGrabberOpenCVImpl::queueHandler() { std::string filename = std::to_string((long) this->framesCounter) + "_" + ptrVf->ts + image_extension; - if (this->storagePathSubdir.empty() || this->storagePath != this->prevStoragePath) { + if (this->storagePathSubdir.empty() || !this->storagePath.compare(this->prevStoragePath)) { this->prevStoragePath = this->storagePath; this->storagePathSubdir = this->storagePath + "/frames_" + this->getCurrentTimestampString(); boost::filesystem::path dir(this->storagePathSubdir.c_str());