X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fflash%2Fproducer%2Fflash_producer.cpp;h=9ac975017b3b4aa683611be3aee444a7ebe42d5e;hb=c4647c09f2092df9a71635d5866da89dce3a4fef;hp=a93e70f08784c6e5efc6f081e67b715a30bc0e8a;hpb=b706389b29b5fd12c9608e856e99f016f0235201;p=casparcg diff --git a/modules/flash/producer/flash_producer.cpp b/modules/flash/producer/flash_producer.cpp index a93e70f08..9ac975017 100644 --- a/modules/flash/producer/flash_producer.cpp +++ b/modules/flash/producer/flash_producer.cpp @@ -95,28 +95,35 @@ struct template_host template_host get_template_host(const core::video_format_desc& desc) { - std::vector template_hosts; - BOOST_FOREACH(auto& xml_mapping, env::properties().get_child("configuration.producers.template-hosts")) + try { - try + std::vector template_hosts; + BOOST_FOREACH(auto& xml_mapping, env::properties().get_child("configuration.producers.template-hosts")) { - template_host template_host; - template_host.field_mode = xml_mapping.second.get("video-mode", narrow(desc.name)); - template_host.filename = xml_mapping.second.get("filename", "cg.fth"); - template_host.width = xml_mapping.second.get("width", desc.width); - template_host.height = xml_mapping.second.get("height", desc.height); - template_hosts.push_back(template_host); + try + { + template_host template_host; + template_host.field_mode = xml_mapping.second.get("video-mode", narrow(desc.name)); + template_host.filename = xml_mapping.second.get("filename", "cg.fth"); + template_host.width = xml_mapping.second.get("width", desc.width); + template_host.height = xml_mapping.second.get("height", desc.height); + template_hosts.push_back(template_host); + } + catch(...){} } - catch(...){} - } - auto template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == narrow(desc.name);}); - if(template_host_it == template_hosts.end()) - template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == "";}); + auto template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == narrow(desc.name);}); + if(template_host_it == template_hosts.end()) + template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == "";}); + + if(template_host_it != template_hosts.end()) + return *template_host_it; + } + catch(...) + { + CASPAR_LOG(info) << L" Found no correct template-host configuration. Using cg.fth."; + } - if(template_host_it != template_hosts.end()) - return *template_host_it; - template_host template_host; template_host.filename = "cg.fth"; template_host.width = desc.width;