From 52763206654199e94f166803405355de7ce0e5ac Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Thu, 14 Nov 2013 17:40:56 -0800 Subject: [PATCH] Don't output unneeded copies of the src templates in stream --- openbr/plugins/stream.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index 0679746..090db81 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -363,7 +363,7 @@ public: return this->templates.size(); } - bool open(TemplateList & input, br::Idiocy::StreamModes _mode) + bool open(const TemplateList & input, br::Idiocy::StreamModes _mode) { // Set up variables specific to us current_template_idx = 0; @@ -1030,8 +1030,10 @@ public: void projectUpdate(const TemplateList & src, TemplateList & dst) { dst = src; + if (src.empty()) + return; - bool res = readStage->dataSource.open(dst,readMode); + bool res = readStage->dataSource.open(src,readMode); if (!res) { qDebug("stream failed to open %s", qPrintable(dst[0].file.name)); return; @@ -1075,9 +1077,9 @@ public: final_output.append(output_set); } + dst.clear(); // dst is set to all output received by the final stage, along // with anything output via the calls to finalize. - //dst = collectionStage->getOutput(); foreach(const TemplateList & list, collector->sets) { dst.append(list); } -- libgit2 0.21.4