summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-07 20:25:36 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-07 20:25:36 +0100
commit9fa643bdebdcb39cca4b529f13fdd0fbfd721d58 (patch)
tree75e07bfe05b9db372ccb9319aedf6d98270e2bbd /src/lib
parentc2930f166cad691fb5302d9924e109443bf2365f (diff)
Catch exceptions on loading config.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc11
-rw-r--r--src/lib/config.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index b6f464717..3beb0aea6 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -61,7 +61,11 @@ Config::Config ()
_allowed_dcp_frame_rates.push_back (48);
_allowed_dcp_frame_rates.push_back (50);
_allowed_dcp_frame_rates.push_back (60);
+}
+void
+Config::read ()
+{
if (!boost::filesystem::exists (file (false))) {
read_old_metadata ();
return;
@@ -199,6 +203,13 @@ Config::instance ()
{
if (_instance == 0) {
_instance = new Config;
+ try {
+ _instance->read ();
+ } catch (...) {
+ /* configuration load failed; never mind, just
+ stick with the default.
+ */
+ }
}
return _instance;
diff --git a/src/lib/config.h b/src/lib/config.h
index 05005e590..96aa4e449 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -213,6 +213,7 @@ public:
private:
Config ();
std::string file (bool) const;
+ void read ();
void read_old_metadata ();
/** number of threads to use for J2K encoding on the local machine */