From cd21d5c0a69a732eccd1c4620b9ccd0555f057c3 Mon Sep 17 00:00:00 2001 From: ronag Date: Sat, 5 Nov 2011 13:31:55 +0000 Subject: [PATCH] 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 --- modules/flash/producer/flash_producer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; -- 2.39.2