From 27f42941f074ff9fa2acac82685b3e178c8014dc Mon Sep 17 00:00:00 2001 From: Helge Norberg Date: Mon, 3 Oct 2016 21:53:48 +0200 Subject: [PATCH] [ffmpeg] Fixed problem where pan audio filter was not correctly parsed in Linux because of a global C locale problem. --- shell/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shell/main.cpp b/shell/main.cpp index d742cb0d9..f5499b958 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -79,6 +79,9 @@ void setup_global_locale() gen.categories(boost::locale::codepage_facet); std::locale::global(gen("")); + + // sscanf is used in for example FFmpeg where we want decimals to be parsed as . + std::setlocale(LC_ALL, "C"); } void print_info() @@ -217,6 +220,9 @@ bool run(const std::wstring& config_file_name, tbb::atomic& should_wait_fo // Create server object which initializes channels, protocols and controllers. std::unique_ptr caspar_server(new server(shutdown_server_now)); + // For example CEF resets the global locale, so this is to reset it back to "our" preference. + setup_global_locale(); + // Print environment information. print_system_info(caspar_server->get_system_info_provider_repo()); -- 2.39.2