From 076a4d1316f5260d8ef8fc04bb2027e748f1e36b Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Sat, 9 Nov 2013 14:15:18 -0500 Subject: [PATCH] Make ProgressCounter behave slightly better --- openbr/core/core.cpp | 3 +-- openbr/plugins/misc.cpp | 2 +- openbr/plugins/stream.cpp | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 1a23139..ab10808 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -151,10 +151,9 @@ struct AlgorithmCore if (data.empty()) return files; - // Trust me, this makes complete sense. // We're just going to make a pipe with a placeholder first transform - QString pipeDesc = "Identity+ProgressCounter("+QString::number(data.length())+")+GalleryOutput("+gallery.flat()+")+Discard"; + QString pipeDesc = "Identity+GalleryOutput("+gallery.flat()+")+ProgressCounter("+QString::number(data.length())+")+Discard"; QScopedPointer basePipe(Transform::make(pipeDesc,NULL)); CompositeTransform * downcast = dynamic_cast(basePipe.data()); diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index 3961085..3dd8c4b 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -602,7 +602,7 @@ class ProgressCounterTransform : public TimeVaryingTransform void init() { - calls = -1; + calls = 0; set_calls = 0; timer.start(); Globals->startTime.start(); diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index 2420705..0679746 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -448,6 +448,8 @@ public: // we will return the first frame on the lookAhead buffer FrameData * rVal = lookAhead.first(); lookAhead.pop_front(); + if (rVal->data.empty()) + qDebug("returning empty frame from look ahead!"); // If this is the last frame, say so if (rVal->sequenceNumber == final_frame) { @@ -675,6 +677,7 @@ public: if (input == NULL) { qFatal("null input to multi-thread stage"); } + input->data >> *transform; should_continue = nextStage->tryAcquireNextStage(input); @@ -1062,6 +1065,8 @@ public: { TemplateList output_set; transforms[i]->finalize(output_set); + if (output_set.empty()) + continue; for (int j=i+1; j < transforms.size();j++) { -- libgit2 0.21.4