Hide some windows warnings.
[dcpomatic.git] / src / lib / ratio.cc
index eae12b061ca0dd04e9692d3cd85eb5e28dd00dd5..93ad5755ddb5fe23abe637a357caee2c88d8d206 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -20,6 +20,7 @@
 
 #include "ratio.h"
 #include "util.h"
+#include "config.h"
 #include <dcp/types.h>
 #include <cfloat>
 
@@ -102,16 +103,25 @@ Ratio::nearest_from_ratio (float r)
 vector<Ratio const *>
 Ratio::containers ()
 {
+       if (Config::instance()->allow_any_container()) {
+               return _ratios;
+       }
+
        vector<Ratio const *> r;
        r.push_back (Ratio::from_id ("185"));
        r.push_back (Ratio::from_id ("239"));
-       r.push_back (Ratio::from_id ("190"));
        return r;
 }
 
 string
 Ratio::container_nickname () const
 {
-       DCPOMATIC_ASSERT (_container_nickname);
+       if (!_container_nickname) {
+               /* Fall back to the image nickname; this just for when non-standard container
+                  ratios are enabled.
+               */
+               return _image_nickname;
+       }
+
        return *_container_nickname;
 }