paths before trying to access the config file. Fixes #654.
abort();
}
-/** Call the required functions to set up DCP-o-matic's static arrays, etc.
- * Must be called from the UI thread, if there is one.
- */
void
-dcpomatic_setup ()
+dcpomatic_setup_path_encoding ()
{
#ifdef DCPOMATIC_WINDOWS
- boost::filesystem::path p = g_get_user_config_dir ();
- p /= "backtrace.txt";
- set_backtrace_file (p);
- SetUnhandledExceptionFilter(exception_handler);
-
/* Dark voodoo which, I think, gets boost::filesystem::path to
correctly convert UTF-8 strings to paths, and also paths
back to UTF-8 strings (on path::string()).
std::locale::global (boost::locale::generator().generate (""));
boost::filesystem::path::imbue (std::locale ());
#endif
+}
+
+/** Call the required functions to set up DCP-o-matic's static arrays, etc.
+ * Must be called from the UI thread, if there is one.
+ */
+void
+dcpomatic_setup ()
+{
+#ifdef DCPOMATIC_WINDOWS
+ boost::filesystem::path p = g_get_user_config_dir ();
+ p /= "backtrace.txt";
+ set_backtrace_file (p);
+ SetUnhandledExceptionFilter(exception_handler);
+#endif
avfilter_register_all ();
extern std::string seconds_to_approximate_hms (int);
extern double seconds (struct timeval);
extern void dcpomatic_setup ();
+extern void dcpomatic_setup_path_encoding ();
extern void dcpomatic_setup_gettext_i18n (std::string);
extern std::string md5_digest_head_tail (std::vector<boost::filesystem::path>, boost::uintmax_t size);
extern void ensure_ui_thread ();
wxInitAllImageHandlers ();
+ dcpomatic_setup_path_encoding ();
+
/* Enable i18n; this will create a Config object
to look for a force-configured language. This Config
object will be wrong, however, because dcpomatic_setup
unsetenv ("UBUNTU_MENUPROXY");
#endif
+ dcpomatic_setup_path_encoding ();
+
/* Enable i18n; this will create a Config object
to look for a force-configured language. This Config
object will be wrong, however, because dcpomatic_setup
film_dir = argv[optind];
+ dcpomatic_setup_path_encoding ();
dcpomatic_setup ();
signal_manager = new SignalManager ();
return error ? EXIT_FAILURE : EXIT_SUCCESS;
}
-
-
int
main (int argc, char* argv[])
{
+ dcpomatic_setup_path_encoding ();
dcpomatic_setup ();
string name;
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
string const film_dir = argv[optind];
+ dcpomatic_setup_path_encoding ();
dcpomatic_setup ();
shared_ptr<Film> film;
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return false;
}
+ dcpomatic_setup_path_encoding ();
dcpomatic_setup ();
_icon = new TaskBarIcon;
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int
main (int argc, char* argv[])
{
+ dcpomatic_setup_path_encoding ();
+ dcpomatic_setup ();
+
int num_threads = Config::instance()->num_local_encoding_threads ();
bool verbose = false;
bool write_log = false;