]> git.sesse.net Git - casparcg/blobdiff - modules/flash/producer/cg_producer.cpp
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / modules / flash / producer / cg_producer.cpp
index 1cb9c09b6f98d6d22310b85edb995c76c14ef2ca..da983e7515a7ff1c1b37189f4bba63f1f2380632 100644 (file)
@@ -29,8 +29,9 @@
 \r
 #include <boost/filesystem.hpp>\r
 #include <boost/format.hpp>\r
+#include <boost/algorithm/string.hpp>\r
                \r
-namespace caspar {\r
+namespace caspar { namespace flash {\r
        \r
 struct cg_producer::implementation : boost::noncopyable\r
 {\r
@@ -115,7 +116,7 @@ safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<core::video_channel
 \r
        if(flash_producer->print().find(L"flash[") == std::string::npos) // UGLY hack\r
        {\r
-               flash_producer = create_flash_producer(video_channel->mixer(), boost::assign::list_of<std::wstring>()); \r
+               flash_producer = flash::create_producer(video_channel->mixer(), boost::assign::list_of<std::wstring>());        \r
                video_channel->stage()->load(render_layer, flash_producer); \r
                video_channel->stage()->play(render_layer);\r
        }\r
@@ -129,7 +130,11 @@ safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_fac
        if(!boost::filesystem::exists(filename))\r
                return core::frame_producer::empty();\r
        \r
-       auto flash_producer = create_flash_producer(frame_factory, boost::assign::list_of<std::wstring>());     \r
+       boost::algorithm::replace_all(filename, L"\\", L"/");\r
+       boost::algorithm::replace_all(filename, L"//", L"/");\r
+       boost::algorithm::replace_all(filename, L"///", L"/");\r
+       \r
+       auto flash_producer = flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>());    \r
        auto producer = make_safe<cg_producer>(flash_producer);\r
        producer->add(0, filename, 1);\r
 \r
@@ -149,4 +154,4 @@ void cg_producer::update(int layer, const std::wstring& data){impl_->update(laye
 void cg_producer::invoke(int layer, const std::wstring& label){impl_->invoke(layer, label);}\r
 std::wstring cg_producer::print() const{return impl_->print();}\r
 \r
-}
\ No newline at end of file
+}}
\ No newline at end of file