]> git.sesse.net Git - casparcg/commitdiff
2.0.2: flash_producer: Automatically find correct template-host based on file extensi...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 5 Nov 2011 13:31:55 +0000 (13:31 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 5 Nov 2011 13:31:55 +0000 (13:31 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1535 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

modules/flash/producer/flash_producer.cpp

index 9ac975017b3b4aa683611be3aee444a7ebe42d5e..aa03e29807fa4c7db71db952e7c9828c25b8a921 100644 (file)
@@ -44,6 +44,7 @@
 #include <boost/filesystem.hpp>\r
 #include <boost/thread.hpp>\r
 #include <boost/timer.hpp>\r
+#include <boost/algorithm/string.hpp>\r
 \r
 #include <functional>\r
 \r
@@ -121,11 +122,20 @@ template_host get_template_host(const core::video_format_desc& desc)
        }\r
        catch(...)\r
        {\r
-               CASPAR_LOG(info) << L" Found no correct template-host configuration. Using cg.fth.";\r
        }\r
-\r
+               \r
        template_host template_host;\r
        template_host.filename = "cg.fth";\r
+\r
+       for(auto it = boost::filesystem2::wdirectory_iterator(env::template_folder()); it != boost::filesystem2::wdirectory_iterator(); ++it)\r
+       {\r
+               if(boost::iequals(it->path().extension(), L"." + desc.name))\r
+               {\r
+                       template_host.filename = narrow(it->filename());\r
+                       break;\r
+               }\r
+       }\r
+\r
        template_host.width = desc.width;\r
        template_host.height = desc.height;\r
        return template_host;\r