From: Ronag Date: Wed, 24 Aug 2011 18:37:22 +0000 (+0000) Subject: git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches... X-Git-Tag: 2.0.1~67 X-Git-Url: https://git.sesse.net/?p=casparcg;a=commitdiff_plain;h=6158d8cd73c7c53c9b5d933d7527381cceaf493c git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1276 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- diff --git a/core/producer/layer.h b/core/producer/layer.h index e7991d1f3..4a1b3b8d3 100644 --- a/core/producer/layer.h +++ b/core/producer/layer.h @@ -24,6 +24,9 @@ #include +#include +#include + namespace caspar { namespace core { struct frame_producer; diff --git a/core/producer/stage.cpp b/core/producer/stage.cpp index 8262b6ebe..6c7816ba9 100644 --- a/core/producer/stage.cpp +++ b/core/producer/stage.cpp @@ -159,7 +159,7 @@ public: { channel_.execution().invoke([&] { - layers_[index].swap(layers_[other_index]); + std::swap(layers_[index], layers_[other_index]); }, high_priority); } @@ -169,7 +169,10 @@ public: swap_layer(index, other_index); else { - auto func = [&]{layers_[index].swap(other.impl_->layers_[other_index]);}; + auto func = [&] + { + std::swap(layers_[index], other.impl_->layers_[other_index]); + }; channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority); } } @@ -181,19 +184,9 @@ public: auto func = [&] { - auto sel_first = [](const std::pair& pair){return pair.first;}; - - std::set indices; - auto inserter = std::inserter(indices, indices.begin()); - - std::transform(layers_.begin(), layers_.end(), inserter, sel_first); - std::transform(other.impl_->layers_.begin(), other.impl_->layers_.end(), inserter, sel_first); - - BOOST_FOREACH(auto index, indices) - layers_[index].swap(other.impl_->layers_[index]); - }; - - channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}); + std::swap(layers_, other.impl_->layers_); + }; + channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority); } layer_status get_status(int index)