]> git.sesse.net Git - casparcg/blobdiff - modules/flash/producer/cg_producer.cpp
2.0.2: ct-producer uses complete path.
[casparcg] / modules / flash / producer / cg_producer.cpp
index 1cb9c09b6f98d6d22310b85edb995c76c14ef2ca..f3dbadcaf1c1a49669140dc243bd24f93949a4ae 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
@@ -128,8 +129,12 @@ safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_fac
        std::wstring filename = env::media_folder() + L"\\" + params[0] + L".ct";\r
        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
+               \r
+       boost::filesystem2::wpath path(filename);\r
+       path = boost::filesystem2::complete(path);\r
+       filename = path.file_string();\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