From: ronag Date: Sat, 5 Nov 2011 13:31:55 +0000 (+0000) Subject: 2.0.2: flash_producer: Automatically find correct template-host based on file extensi... X-Git-Tag: 2.0.0.2~9 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=cd21d5c0a69a732eccd1c4620b9ccd0555f057c3;p=casparcg 2.0.2: flash_producer: Automatically find correct template-host based on file extensions when no configuration is found. git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1535 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- diff --git a/modules/flash/producer/flash_producer.cpp b/modules/flash/producer/flash_producer.cpp index 9ac975017..aa03e2980 100644 --- a/modules/flash/producer/flash_producer.cpp +++ b/modules/flash/producer/flash_producer.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -121,11 +122,20 @@ template_host get_template_host(const core::video_format_desc& desc) } catch(...) { - CASPAR_LOG(info) << L" Found no correct template-host configuration. Using cg.fth."; } - + template_host template_host; template_host.filename = "cg.fth"; + + for(auto it = boost::filesystem2::wdirectory_iterator(env::template_folder()); it != boost::filesystem2::wdirectory_iterator(); ++it) + { + if(boost::iequals(it->path().extension(), L"." + desc.name)) + { + template_host.filename = narrow(it->filename()); + break; + } + } + template_host.width = desc.width; template_host.height = desc.height; return template_host;