Merge 1.0-seek and subtitle-content.
[dcpomatic.git] / src / lib / util.cc
index 381c47a9ae606253a7207a492351965987638c58..ef203c2bdc82fae52119f0acef4b4d4c2ba27764 100644 (file)
@@ -47,6 +47,7 @@
 #include <openssl/md5.h>
 #include <magick/MagickCore.h>
 #include <magick/version.h>
+#include <pangomm/init.h>
 #include <libdcp/version.h>
 #include <libdcp/util.h>
 #include <libdcp/signer_chain.h>
@@ -309,6 +310,7 @@ dcpomatic_setup ()
        setenv ("LTDL_LIBRARY_PATH", lib.c_str (), 1);
 #endif 
 
+       Pango::init ();
        libdcp::init ();
        
        Ratio::setup_ratios ();
@@ -350,6 +352,8 @@ dcpomatic_setup_gettext_i18n (string lang)
                putenv (cmd);
                snprintf (cmd, sizeof(cmd), "LANG=%s", lang.c_str ());
                putenv (cmd);
+               snprintf (cmd, sizeof(cmd), "LC_ALL=%s", lang.c_str ());
+               putenv (cmd);
        }
 
        setlocale (LC_ALL, "");
@@ -539,7 +543,7 @@ Socket::connect (boost::asio::ip::tcp::endpoint endpoint)
        } while (ec == boost::asio::error::would_block);
 
        if (ec) {
-               throw NetworkError (ec.message ());
+               throw NetworkError (String::compose (_("error during async_connect (%1)"), ec.value ()));
        }
 
        if (!_socket.is_open ()) {
@@ -563,7 +567,7 @@ Socket::accept (int port)
        _acceptor = 0;
        
        if (ec) {
-               throw NetworkError (ec.message ());
+               throw NetworkError (String::compose (_("error during async_accept (%1)"), ec.value ()));
        }
 }
 
@@ -584,7 +588,7 @@ Socket::write (uint8_t const * data, int size)
        } while (ec == boost::asio::error::would_block);
 
        if (ec) {
-               throw NetworkError (ec.message ());
+               throw NetworkError (String::compose (_("error during async_write (%1)"), ec.value ()));
        }
 }
 
@@ -612,7 +616,7 @@ Socket::read (uint8_t* data, int size)
        } while (ec == boost::asio::error::would_block);
        
        if (ec) {
-               throw NetworkError (ec.message ());
+               throw NetworkError (String::compose (_("error during async_read (%1)"), ec.value ()));
        }
 }
 
@@ -747,7 +751,7 @@ ensure_ui_thread ()
  *  @return Equivalent number of audio frames for `v'.
  */
 int64_t
-video_frames_to_audio_frames (VideoContent::Frame v, float audio_sample_rate, float frames_per_second)
+video_frames_to_audio_frames (VideoFrame v, float audio_sample_rate, float frames_per_second)
 {
        return ((int64_t) v * audio_sample_rate / frames_per_second);
 }