]> git.sesse.net Git - casparcg/commitdiff
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
authorRonag <Ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 24 Aug 2011 18:37:22 +0000 (18:37 +0000)
committerRonag <Ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 24 Aug 2011 18:37:22 +0000 (18:37 +0000)
core/producer/layer.h
core/producer/stage.cpp

index e7991d1f310ad7b39c78fe473735a92bda6540c8..4a1b3b8d3d268a34318d681c5ac37fa63989715c 100644 (file)
@@ -24,6 +24,9 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
+#include <string>\r
+#include <utility>\r
+\r
 namespace caspar { namespace core {\r
 \r
 struct frame_producer;\r
index 8262b6ebeaa767e7823f587f64c478035bf0699c..6c7816ba91d345de3c42f583f86efb1fcf3e0759 100644 (file)
@@ -159,7 +159,7 @@ public:
        {\r
                channel_.execution().invoke([&]\r
                {\r
-                       layers_[index].swap(layers_[other_index]);\r
+                       std::swap(layers_[index], layers_[other_index]);\r
                }, high_priority);\r
        }\r
 \r
@@ -169,7 +169,10 @@ public:
                        swap_layer(index, other_index);\r
                else\r
                {\r
-                       auto func = [&]{layers_[index].swap(other.impl_->layers_[other_index]);};               \r
+                       auto func = [&]\r
+                       {\r
+                               std::swap(layers_[index], other.impl_->layers_[other_index]);\r
+                       };              \r
                        channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority);\r
                }\r
        }\r
@@ -181,19 +184,9 @@ public:
                \r
                auto func = [&]\r
                {\r
-                       auto sel_first = [](const std::pair<int, layer>& pair){return pair.first;};\r
-\r
-                       std::set<int> indices;\r
-                       auto inserter = std::inserter(indices, indices.begin());\r
-\r
-                       std::transform(layers_.begin(), layers_.end(), inserter, sel_first);\r
-                       std::transform(other.impl_->layers_.begin(), other.impl_->layers_.end(), inserter, sel_first);\r
-\r
-                       BOOST_FOREACH(auto index, indices)\r
-                               layers_[index].swap(other.impl_->layers_[index]);\r
-               };\r
-               \r
-               channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);});\r
+                       std::swap(layers_, other.impl_->layers_);\r
+               };              \r
+               channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority);\r
        }\r
 \r
        layer_status get_status(int index)\r