Allow specification of subtitle language even if DVD-o-matic isn't providing the...
[dcpomatic.git] / src / lib / util.cc
index 1d1372049451b274f7aa9417be9fa4088c2a5503..1c4347233965279203a494dbde8fde06141b9ed8 100644 (file)
@@ -285,7 +285,7 @@ dcpomatic_setup ()
        */
        boost::filesystem::path lib = app_contents ();
        lib /= "lib";
-       lt_dladdsearchdir (lib.c_str ());
+       setenv ("LTDL_LIBRARY_PATH", lib.c_str (), 1);
 #endif 
 
        libdcp::init ();
@@ -882,3 +882,12 @@ make_signer ()
        return shared_ptr<const libdcp::Signer> (new libdcp::Signer (chain, signer_key));
 }
 
+libdcp::Size
+fit_ratio_within (float ratio, libdcp::Size full_frame)
+{
+       if (ratio < full_frame.ratio ()) {
+               return libdcp::Size (full_frame.height * ratio, full_frame.height);
+       }
+       
+       return libdcp::Size (full_frame.width, full_frame.width / ratio);
+}