Skip to content

Commit

Permalink
change directory creation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi Saranga committed Jul 24, 2018
1 parent bcdf8a4 commit acb4f53
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit acb4f53

Please sign in to comment.