Merge master.
authorCarl Hetherington <cth@carlh.net>
Fri, 16 May 2014 11:32:04 +0000 (12:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 16 May 2014 11:32:04 +0000 (12:32 +0100)
31 files changed:
1  2 
ChangeLog
src/lib/audio_content.cc
src/lib/audio_mapping.cc
src/lib/colour_conversion.cc
src/lib/config.cc
src/lib/config.h
src/lib/content.cc
src/lib/dci_metadata.cc
src/lib/dcp_video_frame.cc
src/lib/ffmpeg.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_content.h
src/lib/ffmpeg_decoder.cc
src/lib/film.cc
src/lib/image_examiner.cc
src/lib/kdm.cc
src/lib/playlist.cc
src/lib/server.cc
src/lib/server_finder.cc
src/lib/sndfile_content.cc
src/lib/subrip_content.cc
src/lib/subtitle_content.cc
src/lib/update.cc
src/lib/util.cc
src/lib/util.h
src/lib/video_content.cc
src/tools/dcpomatic.cc
src/wx/audio_mapping_view.cc
src/wx/config_dialog.cc
src/wx/film_editor.cc
test/ratio_test.cc

diff --cc ChangeLog
index 662983a74a4598610f8752a66c8dc5d800c8c61c,807130428281c596b6e42fe0175bc87d36332e9c..33b7e2e2122049f2fdb9bc98245bce6f6b3d9c6b
+++ b/ChangeLog
@@@ -1,7 -1,51 +1,55 @@@
 +2014-03-07  Carl Hetherington  <cth@carlh.net>
 +
 +      * Add subtitle view.
 +
+ 2014-05-16  Carl Hetherington  <cth@carlh.net>
+       * Version 1.69.8 released.
+ 2014-05-16  Carl Hetherington  <cth@carlh.net>
+       * Fix various confusions in translations of abbreviated
+       channel names (Lc, Rc etc.)
+ 2014-05-14  Carl Hetherington  <cth@carlh.net>
+       * Version 1.69.7 released.
+ 2014-05-14  Carl Hetherington  <cth@carlh.net>
+       * Bump libdcp to remove checks on PCM MXF edit rates,
+       so we can generate strange ones in DCP-o-matic.
+ 2014-05-13  Carl Hetherington  <cth@carlh.net>
+       * Version 1.69.6 released.
+ 2014-05-13  Carl Hetherington  <cth@carlh.net>
+       * Remove artificial 100fps limit when using
+       "any" DCP frame rate.
+ 2014-05-12  Carl Hetherington  <cth@carlh.net>
+       * Version 1.69.5 released.
+ 2014-05-12  Carl Hetherington  <cth@carlh.net>
+       * Add option to use any DCP frame rate, rather than just
+       the "allowed" set.
+       * Version 1.69.4 released.
+ 2014-05-12  Carl Hetherington  <cth@carlh.net>
+       * Version 1.69.3 released.
+ 2014-05-12  Carl Hetherington  <cth@carlh.net>
+       * Use libdcp::raw_convert instead of boost::lexical_cast and
+       LocaleGuard, hopefully to fix large numbers being written with
+       thousands separators on some locales.
  2014-05-10  Carl Hetherington  <cth@carlh.net>
  
        * Version 1.69.2 released.
index d9e00ff1401ca4e3335ea51c2944aff404a94fae,1896c4d5c356ad5105ab952c2e9f0067a2c77931..e8fd4bbd39d0e93813bd78b325624307e60e4750
@@@ -18,6 -18,7 +18,7 @@@
  */
  
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "audio_content.h"
  #include "analyse_audio_job.h"
  #include "job_manager.h"
@@@ -30,8 -31,8 +31,8 @@@
  using std::string;
  using std::vector;
  using boost::shared_ptr;
- using boost::lexical_cast;
  using boost::dynamic_pointer_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  int const AudioContentProperty::AUDIO_CHANNELS = 200;
  int const AudioContentProperty::AUDIO_LENGTH = 201;
index 969397b0bdf9a1a43f696cfc9d4b22ac04e125ef,b1810c97349e0652767e0940084b3db0b7add927..496300b48a746931f419748231f24f70364f4493
@@@ -17,9 -17,9 +17,9 @@@
  
  */
  
- #include <boost/lexical_cast.hpp>
  #include <libxml++/libxml++.h>
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "audio_mapping.h"
  #include "util.h"
  
@@@ -30,8 -30,8 +30,8 @@@ using std::pair
  using std::string;
  using std::min;
  using boost::shared_ptr;
- using boost::lexical_cast;
  using boost::dynamic_pointer_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  AudioMapping::AudioMapping ()
        : _content_channels (0)
@@@ -93,8 -93,8 +93,8 @@@ AudioMapping::AudioMapping (shared_ptr<
                for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
                        set (
                                (*i)->number_attribute<int> ("Content"),
 -                              static_cast<libdcp::Channel> ((*i)->number_attribute<int> ("DCP")),
 +                              static_cast<dcp::Channel> ((*i)->number_attribute<int> ("DCP")),
-                               lexical_cast<float> ((*i)->content ())
+                               raw_convert<float> ((*i)->content ())
                                );
                }
        }
@@@ -120,9 -120,9 +120,9 @@@ AudioMapping::as_xml (xmlpp::Node* node
        for (int c = 0; c < _content_channels; ++c) {
                for (int d = 0; d < MAX_DCP_AUDIO_CHANNELS; ++d) {
                        xmlpp::Element* t = node->add_child ("Gain");
-                       t->set_attribute ("Content", lexical_cast<string> (c));
-                       t->set_attribute ("DCP", lexical_cast<string> (d));
-                       t->add_child_text (lexical_cast<string> (get (c, static_cast<dcp::Channel> (d))));
+                       t->set_attribute ("Content", raw_convert<string> (c));
+                       t->set_attribute ("DCP", raw_convert<string> (d));
 -                      t->add_child_text (raw_convert<string> (get (c, static_cast<libdcp::Channel> (d))));
++                      t->add_child_text (raw_convert<string> (get (c, static_cast<dcp::Channel> (d))));
                }
        }
  }
index e4a2a84bff4bc826355d0d20c60bbba4eb9b49e0,cd1a81b257dcadfa76b1c6196ae7e7267f9dfce6..73ee722490eaa33a7b46c1182459f9ea0164d67a
@@@ -17,9 -17,9 +17,9 @@@
  
  */
  
- #include <boost/lexical_cast.hpp>
  #include <libxml++/libxml++.h>
 -#include <libdcp/colour_matrix.h>
 -#include <libdcp/raw_convert.h>
 +#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
  #include <libcxml/cxml.h>
  #include "config.h"
  #include "colour_conversion.h"
@@@ -32,8 -32,8 +32,8 @@@ using std::string
  using std::cout;
  using std::vector;
  using boost::shared_ptr;
- using boost::lexical_cast;
  using boost::optional;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  ColourConversion::ColourConversion ()
        : input_gamma (2.4)
index ca8d0bc53c407182c8b39dc0770648574f1d9e51,40ae3971be9bd0ba5781bb9496bb7f9bf2f7b257..754346418e2f4c83b66b0972a1e7868497620fd5
@@@ -23,7 -23,8 +23,8 @@@
  #include <glib.h>
  #include <boost/filesystem.hpp>
  #include <boost/algorithm/string.hpp>
 -#include <libdcp/colour_matrix.h>
 -#include <libdcp/raw_convert.h>
 +#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
  #include <libcxml/cxml.h>
  #include "config.h"
  #include "server.h"
@@@ -49,7 -50,7 +50,7 @@@ using boost::shared_ptr
  using boost::optional;
  using boost::algorithm::is_any_of;
  using boost::algorithm::split;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  Config* Config::_instance = 0;
  
Simple merge
index 0c37d938637cd8af26ad8e9db32b5f7bce0f9409,1ec607d394896b8ec0dbdc7ad1dbeacb7cfb7393..c4836cfa89a643c1838bc94ef302a99c661d9418
@@@ -24,6 -20,7 +24,7 @@@
  #include <boost/thread/mutex.hpp>
  #include <libxml++/libxml++.h>
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "content.h"
  #include "util.h"
  #include "content_factory.h"
@@@ -40,7 -37,7 +41,7 @@@ using std::list
  using std::cout;
  using std::vector;
  using boost::shared_ptr;
- using boost::lexical_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  int const ContentProperty::PATH = 400;
  int const ContentProperty::POSITION = 401;
@@@ -123,9 -120,9 +124,9 @@@ Content::as_xml (xmlpp::Node* node) con
                node->add_child("Path")->add_child_text (i->string ());
        }
        node->add_child("Digest")->add_child_text (_digest);
-       node->add_child("Position")->add_child_text (lexical_cast<string> (_position.get ()));
-       node->add_child("TrimStart")->add_child_text (lexical_cast<string> (_trim_start.get ()));
-       node->add_child("TrimEnd")->add_child_text (lexical_cast<string> (_trim_end.get ()));
 -      node->add_child("Position")->add_child_text (raw_convert<string> (_position));
 -      node->add_child("TrimStart")->add_child_text (raw_convert<string> (_trim_start));
 -      node->add_child("TrimEnd")->add_child_text (raw_convert<string> (_trim_end));
++      node->add_child("Position")->add_child_text (raw_convert<string> (_position.get ()));
++      node->add_child("TrimStart")->add_child_text (raw_convert<string> (_trim_start.get ()));
++      node->add_child("TrimEnd")->add_child_text (raw_convert<string> (_trim_end.get ()));
  }
  
  void
index 27306a15e48f2c1f6c44c7eb10bf90867a98a7f2,ccdc1ee1ca73d70720481497f392881f53caf101..2c6e43654915b239d94f4ff6acb61df9389d42fa
  
  #include <iostream>
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "dci_metadata.h"
  
  #include "i18n.h"
  
  using std::string;
- using boost::lexical_cast;
  using boost::shared_ptr;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  DCIMetadata::DCIMetadata (shared_ptr<const cxml::Node> node)
  {
index 2b7a2e18f6b2ff712ba6baf47b9e074f44681676,1c12eb7fd7b9a6022de7e0a1b26895d3256669b7..59f356a5a78b297e0f54da14143a8ef43e2345a1
  #include <boost/array.hpp>
  #include <boost/asio.hpp>
  #include <boost/filesystem.hpp>
 -#include <libdcp/rec709_linearised_gamma_lut.h>
 -#include <libdcp/srgb_linearised_gamma_lut.h>
 -#include <libdcp/gamma_lut.h>
 -#include <libdcp/xyz_frame.h>
 -#include <libdcp/rgb_xyz.h>
 -#include <libdcp/colour_matrix.h>
 -#include <libdcp/raw_convert.h>
 +#include <boost/lexical_cast.hpp>
 +#include <dcp/gamma_lut.h>
 +#include <dcp/xyz_frame.h>
 +#include <dcp/rgb_xyz.h>
 +#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
  #include <libcxml/cxml.h>
  #include "film.h"
  #include "dcp_video_frame.h"
@@@ -65,8 -67,8 +66,9 @@@ using std::string
  using std::stringstream;
  using std::cout;
  using boost::shared_ptr;
 -using libdcp::Size;
 -using libdcp::raw_convert;
 +using boost::lexical_cast;
 +using dcp::Size;
++using dcp::raw_convert;
  
  #define DCI_COEFFICENT (48.0 / 52.37)
  
index a98aa98289e6839dedf04ccc557c33b68d1e9c71,7ecc811be879a5af330402829377c7697a7204c2..316b9614de6f27bb18b26278e2fd21006e65d95f
@@@ -22,6 -22,7 +22,7 @@@ extern "C" 
  #include <libavformat/avformat.h>
  #include <libswscale/swscale.h>
  }
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "ffmpeg.h"
  #include "ffmpeg_content.h"
  #include "exceptions.h"
@@@ -33,7 -34,7 +34,7 @@@ using std::string
  using std::cout;
  using std::stringstream;
  using boost::shared_ptr;
- using boost::lexical_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  boost::mutex FFmpeg::_mutex;
  
index a51cb3de805cdcdefe8910e9c8bade812601441d,f810d53be21374e27cd3e929214d04130fcb98b6..a374bcf3e7496932b5f843c16e4b07458286a4fa
@@@ -152,7 -153,7 +153,7 @@@ FFmpegContent::as_xml (xmlpp::Node* nod
        }
  
        if (_first_video) {
-               node->add_child("FirstVideo")->add_child_text (lexical_cast<string> (_first_video.get().get()));
 -              node->add_child("FirstVideo")->add_child_text (raw_convert<string> (_first_video.get ()));
++              node->add_child("FirstVideo")->add_child_text (raw_convert<string> (_first_video.get().get()));
        }
  }
  
@@@ -338,10 -370,10 +339,10 @@@ voi
  FFmpegAudioStream::as_xml (xmlpp::Node* root) const
  {
        FFmpegStream::as_xml (root);
-       root->add_child("FrameRate")->add_child_text (lexical_cast<string> (frame_rate));
-       root->add_child("Channels")->add_child_text (lexical_cast<string> (channels));
+       root->add_child("FrameRate")->add_child_text (raw_convert<string> (frame_rate));
+       root->add_child("Channels")->add_child_text (raw_convert<string> (channels));
        if (first_audio) {
-               root->add_child("FirstAudio")->add_child_text (lexical_cast<string> (first_audio.get().get()));
 -              root->add_child("FirstAudio")->add_child_text (raw_convert<string> (first_audio.get ()));
++              root->add_child("FirstAudio")->add_child_text (raw_convert<string> (first_audio.get().get()));
        }
        mapping.as_xml (root->add_child("Mapping"));
  }
index 1ab0a92d0ed2f89dc329d66a0b392581a499af5c,6ab95d2fe9d2bf53a08acd050845721ed40fc1a1..37746ac9db213ed73ec9a63931347c3ed2475360
@@@ -21,6 -21,6 +21,7 @@@
  #define DCPOMATIC_FFMPEG_CONTENT_H
  
  #include <boost/enable_shared_from_this.hpp>
++#include <boost/lexical_cast.hpp>
  #include "video_content.h"
  #include "audio_content.h"
  #include "subtitle_content.h"
Simple merge
diff --cc src/lib/film.cc
index 33cb304600cda8146deb44a6d1ada1e214925729,12a57753f4aa5a03806cbc20ce3cad2f14080754..bdd650437568cd62ce2702ac931383384cc20666
  #include <unistd.h>
  #include <boost/filesystem.hpp>
  #include <boost/algorithm/string.hpp>
 -#include <boost/date_time.hpp>
 +#include <boost/lexical_cast.hpp>
  #include <libxml++/libxml++.h>
  #include <libcxml/cxml.h>
 -#include <libdcp/signer_chain.h>
 -#include <libdcp/cpl.h>
 -#include <libdcp/signer.h>
 -#include <libdcp/util.h>
 -#include <libdcp/kdm.h>
 -#include <libdcp/raw_convert.h>
 +#include <dcp/signer_chain.h>
 +#include <dcp/cpl.h>
 +#include <dcp/signer.h>
 +#include <dcp/util.h>
 +#include <dcp/local_time.h>
++#include <dcp/raw_convert.h>
  #include "film.h"
  #include "job.h"
  #include "util.h"
@@@ -77,8 -77,9 +77,9 @@@ using boost::to_upper_copy
  using boost::ends_with;
  using boost::starts_with;
  using boost::optional;
 -using libdcp::Size;
 -using libdcp::Signer;
 -using libdcp::raw_convert;
 +using dcp::Size;
 +using dcp::Signer;
++using dcp::raw_convert;
  
  /* 5 -> 6
   * AudioMapping XML changed.
Simple merge
diff --cc src/lib/kdm.cc
Simple merge
Simple merge
index bf7541c3379f1f294f735f4c130b06994b0311d8,0c5792ae0da6b8d07d678e5244b6b04b381645e6..6bcff7e6e93db1204cfc2d2ec73c7179a99b55ce
@@@ -27,9 -27,9 +27,9 @@@
  #include <sstream>
  #include <iostream>
  #include <boost/algorithm/string.hpp>
- #include <boost/lexical_cast.hpp>
  #include <boost/scoped_array.hpp>
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "server.h"
  #include "util.h"
  #include "scaler.h"
@@@ -56,8 -56,8 +56,8 @@@ using boost::thread
  using boost::bind;
  using boost::scoped_array;
  using boost::optional;
- using boost::lexical_cast;
 -using libdcp::Size;
 -using libdcp::raw_convert;
 +using dcp::Size;
++using dcp::raw_convert;
  
  Server::Server (shared_ptr<Log> log, bool verbose)
        : _log (log)
index 1080d24c4103765fce705019b177c19b4a415275,ed6016c6723f51e1be2f028b67fc952fda482978..de8a3852c5cf45c0abd52faaf94b4f08ee24e94c
@@@ -18,6 -18,7 +18,7 @@@
  */
  
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "server_finder.h"
  #include "exceptions.h"
  #include "util.h"
@@@ -32,7 -33,7 +33,7 @@@ using std::vector
  using std::cout;
  using boost::shared_ptr;
  using boost::scoped_array;
- using boost::lexical_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  ServerFinder* ServerFinder::_instance = 0;
  
index 0cf65967f2172ac1f8ad7d57a6a648cfcd05a45d,fcdf88778ac81173080aebfbda9cbf832d8a169c..cad5eb8e73704d2ba15bdf6d2b0a58210c112ade
@@@ -18,6 -18,7 +18,7 @@@
  */
  
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "sndfile_content.h"
  #include "sndfile_decoder.h"
  #include "film.h"
@@@ -31,7 -32,9 +32,7 @@@ using std::string
  using std::stringstream;
  using std::cout;
  using boost::shared_ptr;
- using boost::lexical_cast;
 -using libdcp::raw_convert;
 -
 -int const SndfileContentProperty::VIDEO_FRAME_RATE = 600;
++using dcp::raw_convert;
  
  SndfileContent::SndfileContent (shared_ptr<const Film> f, boost::filesystem::path p)
        : Content (f, p)
@@@ -132,9 -138,9 +133,9 @@@ SndfileContent::as_xml (xmlpp::Node* no
        Content::as_xml (node);
        AudioContent::as_xml (node);
  
-       node->add_child("AudioChannels")->add_child_text (lexical_cast<string> (audio_channels ()));
-       node->add_child("AudioLength")->add_child_text (lexical_cast<string> (audio_length().get ()));
-       node->add_child("AudioFrameRate")->add_child_text (lexical_cast<string> (audio_frame_rate ()));
+       node->add_child("AudioChannels")->add_child_text (raw_convert<string> (audio_channels ()));
 -      node->add_child("AudioLength")->add_child_text (raw_convert<string> (audio_length ()));
 -      node->add_child("AudioFrameRate")->add_child_text (raw_convert<string> (content_audio_frame_rate ()));
++      node->add_child("AudioLength")->add_child_text (raw_convert<string> (audio_length().get ()));
++      node->add_child("AudioFrameRate")->add_child_text (raw_convert<string> (audio_frame_rate ()));
        _audio_mapping.as_xml (node->add_child("AudioMapping"));
  }
  
index eb9c67d9a1948b709544c9cee4588e7e431545ce,0000000000000000000000000000000000000000..8f9c28e293c15bfe9335e0f9f7fe9bc24edca1de
mode 100644,000000..100644
--- /dev/null
@@@ -1,113 -1,0 +1,111 @@@
-       LocaleGuard lg;
-       
 +/*
 +    Copyright (C) 2014 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
 +    the Free Software Foundation; either version 2 of the License, or
 +    (at your option) any later version.
 +
 +    This program is distributed in the hope that it will be useful,
 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +    GNU General Public License for more details.
 +
 +    You should have received a copy of the GNU General Public License
 +    along with this program; if not, write to the Free Software
 +    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 +
 +*/
 +
 +#include "subrip_content.h"
 +#include "util.h"
 +#include "subrip.h"
 +#include "film.h"
++#include <dcp/raw_convert.h>
 +
 +#include "i18n.h"
 +
 +using std::stringstream;
 +using std::string;
 +using std::cout;
++using dcp::raw_convert;
 +using boost::shared_ptr;
 +using boost::lexical_cast;
 +
 +SubRipContent::SubRipContent (shared_ptr<const Film> film, boost::filesystem::path path)
 +      : Content (film, path)
 +      , SubtitleContent (film, path)
 +{
 +
 +}
 +
 +SubRipContent::SubRipContent (shared_ptr<const Film> film, shared_ptr<const cxml::Node> node, int version)
 +      : Content (film, node)
 +      , SubtitleContent (film, node, version)
 +      , _length (node->number_child<int64_t> ("Length"))
 +{
 +
 +}
 +
 +void
 +SubRipContent::examine (boost::shared_ptr<Job> job)
 +{
 +      Content::examine (job);
 +      SubRip s (shared_from_this ());
 +
 +      shared_ptr<const Film> film = _film.lock ();
 +      assert (film);
 +      
 +      DCPTime len (s.length (), film->active_frame_rate_change (position ()));
 +
 +      boost::mutex::scoped_lock lm (_mutex);
 +      _length = len;
 +}
 +
 +string
 +SubRipContent::summary () const
 +{
 +      return path_summary() + " " + _("[subtitles]");
 +}
 +
 +string
 +SubRipContent::technical_summary () const
 +{
 +      return Content::technical_summary() + " - " + _("SubRip subtitles");
 +}
 +
 +string
 +SubRipContent::information () const
 +{
 +      
 +}
 +      
 +void
 +SubRipContent::as_xml (xmlpp::Node* node) const
 +{
-       node->add_child("Length")->add_child_text (lexical_cast<string> (_length.get ()));
 +      node->add_child("Type")->add_child_text ("SubRip");
 +      Content::as_xml (node);
 +      SubtitleContent::as_xml (node);
-       LocaleGuard lg;
++      node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ()));
 +}
 +
 +DCPTime
 +SubRipContent::full_length () const
 +{
 +      /* XXX: this assumes that the timing of the SubRip file is appropriate
 +         for the DCP's frame rate.
 +      */
 +      return _length;
 +}
 +
 +string
 +SubRipContent::identifier () const
 +{
-         << "_" << subtitle_scale()
-         << "_" << subtitle_x_offset()
-         << "_" << subtitle_y_offset();
 +      stringstream s;
 +      s << Content::identifier()
++        << "_" << raw_convert<string> (subtitle_scale())
++        << "_" << raw_convert<string> (subtitle_x_offset())
++        << "_" << raw_convert<string> (subtitle_y_offset());
 +
 +      return s.str ();
 +}
index 4c6e601926d2ebf096450a443ee7560bda152fba,0abb7d491ec57ffff13e2d483fc67e282fd473fb..783c73e254aaa75b743adae6b5c5851b84d4b3b7
@@@ -18,6 -18,7 +18,7 @@@
  */
  
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "subtitle_content.h"
  #include "util.h"
  #include "exceptions.h"
  
  using std::string;
  using std::vector;
 +using std::cout;
  using boost::shared_ptr;
- using boost::lexical_cast;
  using boost::dynamic_pointer_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  int const SubtitleContentProperty::SUBTITLE_X_OFFSET = 500;
  int const SubtitleContentProperty::SUBTITLE_Y_OFFSET = 501;
index 019db8e761ea619c26848ec822c16b517f363ea1,34eaf385c92e77340b361ad634705083a938a459..c7527ee493624247468b365cde6b2363acb5496f
@@@ -22,6 -22,7 +22,7 @@@
  #include <boost/algorithm/string.hpp>
  #include <curl/curl.h>
  #include <libcxml/cxml.h>
 -#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
  #include "update.h"
  #include "version.h"
  #include "ui_signaller.h"
@@@ -32,9 -33,8 +33,9 @@@ using std::cout
  using std::min;
  using std::string;
  using std::stringstream;
- using boost::lexical_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
 +/** Singleton instance */
  UpdateChecker* UpdateChecker::_instance = 0;
  
  static size_t
diff --cc src/lib/util.cc
index 0eb14845d7da6dba601412a34c72544cd590db4b,a5111b7dc121d18c65211757ffb7c96791b7add7..14dfd1fa558b6afa86c7dc03a2b05b139d9bce4d
  #include <glib.h>
  #include <openjpeg.h>
  #include <openssl/md5.h>
 +#include <pangomm/init.h>
  #include <magick/MagickCore.h>
  #include <magick/version.h>
 -#include <libdcp/version.h>
 -#include <libdcp/util.h>
 -#include <libdcp/signer_chain.h>
 -#include <libdcp/signer.h>
 -#include <libdcp/raw_convert.h>
 +#include <dcp/version.h>
 +#include <dcp/util.h>
 +#include <dcp/signer_chain.h>
 +#include <dcp/signer.h>
++#include <dcp/raw_convert.h>
  extern "C" {
  #include <libavcodec/avcodec.h>
  #include <libavformat/avformat.h>
@@@ -101,9 -99,9 +101,9 @@@ using std::streampos
  using std::set_terminate;
  using boost::shared_ptr;
  using boost::thread;
- using boost::lexical_cast;
  using boost::optional;
 -using libdcp::Size;
 -using libdcp::raw_convert;
 +using dcp::Size;
++using dcp::raw_convert;
  
  static boost::thread::id ui_thread;
  static boost::filesystem::path backtrace_file;
@@@ -761,25 -814,44 +761,6 @@@ audio_channel_name (int c
        return channels[c];
  }
  
- LocaleGuard::LocaleGuard ()
-       : _old (0)
 -FrameRateConversion::FrameRateConversion (float source, int dcp)
 -      : skip (false)
 -      , repeat (1)
 -      , change_speed (false)
--{
-       char const * old = setlocale (LC_NUMERIC, 0);
 -      if (fabs (source / 2.0 - dcp) < fabs (source - dcp)) {
 -              /* The difference between source and DCP frame rate will be lower
 -                 (i.e. better) if we skip.
 -              */
 -              skip = true;
 -      } else if (fabs (source * 2 - dcp) < fabs (source - dcp)) {
 -              /* The difference between source and DCP frame rate would be better
 -                 if we repeated each frame once; it may be better still if we
 -                 repeated more than once.  Work out the required repeat.
 -              */
 -              repeat = round (dcp / source);
 -      }
--
-       if (old) {
-               _old = strdup (old);
-               if (strcmp (_old, "C")) {
-                       setlocale (LC_NUMERIC, "C");
 -      change_speed = !about_equal (source * factor(), dcp);
 -
 -      if (!skip && repeat == 1 && !change_speed) {
 -              description = _("Content and DCP have the same rate.\n");
 -      } else {
 -              if (skip) {
 -                      description = _("DCP will use every other frame of the content.\n");
 -              } else if (repeat == 2) {
 -                      description = _("Each content frame will be doubled in the DCP.\n");
 -              } else if (repeat > 2) {
 -                      description = String::compose (_("Each content frame will be repeated %1 more times in the DCP.\n"), repeat - 1);
--              }
-       }
- }
--
- LocaleGuard::~LocaleGuard ()
- {
-       setlocale (LC_NUMERIC, _old);
-       free (_old);
 -              if (change_speed) {
 -                      float const pc = dcp * 100 / (source * factor());
 -                      description += String::compose (_("DCP will run at %1%% of the content speed.\n"), pc);
 -              }
 -      }
--}
--
  bool
  valid_image_file (boost::filesystem::path f)
  {
diff --cc src/lib/util.h
index 8e65bbb5415cc236e496e56a83b92dbd45503082,e85abf402d8ec1637570222a923c7708c6242601..58c2771b7cebd8e46b9d700c3218041abd3dadd4
@@@ -131,19 -164,8 +131,11 @@@ private
        int _timeout;
  };
  
- class LocaleGuard
- {
- public:
-       LocaleGuard ();
-       ~LocaleGuard ();
-       
- private:
-       char* _old;
- };
+ extern int64_t video_frames_to_audio_frames (VideoContent::Frame v, float audio_sample_rate, float frames_per_second);
  
 +/** @class ScopedTemporary
 + *  @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope.
 + */
  class ScopedTemporary
  {
  public:
index 9edbc104a92d3daa77a0a19b46dd18d55317c14e,783cddafad958fcb5ee81cc3806bea3dc2dff8e8..bd24621f79fe72c144d04bf33edaf908cadb61b8
@@@ -19,7 -19,8 +19,8 @@@
  
  #include <iomanip>
  #include <libcxml/cxml.h>
 -#include <libdcp/colour_matrix.h>
 -#include <libdcp/raw_convert.h>
 +#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
  #include "video_content.h"
  #include "video_examiner.h"
  #include "compose.hpp"
@@@ -45,9 -46,9 +46,9 @@@ using std::setprecision
  using std::cout;
  using std::vector;
  using boost::shared_ptr;
- using boost::lexical_cast;
  using boost::optional;
  using boost::dynamic_pointer_cast;
 -using libdcp::raw_convert;
++using dcp::raw_convert;
  
  vector<VideoContentScale> VideoContentScale::_scales;
  
@@@ -155,15 -156,15 +156,15 @@@ voi
  VideoContent::as_xml (xmlpp::Node* node) const
  {
        boost::mutex::scoped_lock lm (_mutex);
-       node->add_child("VideoLength")->add_child_text (lexical_cast<string> (_video_length.get ()));
-       node->add_child("VideoWidth")->add_child_text (lexical_cast<string> (_video_size.width));
-       node->add_child("VideoHeight")->add_child_text (lexical_cast<string> (_video_size.height));
-       node->add_child("VideoFrameRate")->add_child_text (lexical_cast<string> (_video_frame_rate));
-       node->add_child("VideoFrameType")->add_child_text (lexical_cast<string> (static_cast<int> (_video_frame_type)));
-       node->add_child("LeftCrop")->add_child_text (boost::lexical_cast<string> (_crop.left));
-       node->add_child("RightCrop")->add_child_text (boost::lexical_cast<string> (_crop.right));
-       node->add_child("TopCrop")->add_child_text (boost::lexical_cast<string> (_crop.top));
-       node->add_child("BottomCrop")->add_child_text (boost::lexical_cast<string> (_crop.bottom));
 -      node->add_child("VideoLength")->add_child_text (raw_convert<string> (_video_length));
++      node->add_child("VideoLength")->add_child_text (raw_convert<string> (_video_length.get ()));
+       node->add_child("VideoWidth")->add_child_text (raw_convert<string> (_video_size.width));
+       node->add_child("VideoHeight")->add_child_text (raw_convert<string> (_video_size.height));
+       node->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_video_frame_rate));
+       node->add_child("VideoFrameType")->add_child_text (raw_convert<string> (static_cast<int> (_video_frame_type)));
+       node->add_child("LeftCrop")->add_child_text (raw_convert<string> (_crop.left));
+       node->add_child("RightCrop")->add_child_text (raw_convert<string> (_crop.right));
+       node->add_child("TopCrop")->add_child_text (raw_convert<string> (_crop.top));
+       node->add_child("BottomCrop")->add_child_text (raw_convert<string> (_crop.bottom));
        _scale.as_xml (node->add_child("Scale"));
        _colour_conversion.as_xml (node->add_child("ColourConversion"));
  }
Simple merge
index 9375010865dbc0cc2a9c0dd34834edd97d53934f,c1f3e2067a150a3e4790468700103034a74d29f8..ac85407a2f4a5938fb9fd2538a022189f98d87ca
@@@ -30,6 -26,6 +30,7 @@@
  #include "audio_mapping_view.h"
  #include "wx_util.h"
  #include "audio_gain_dialog.h"
++#include <boost/lexical_cast.hpp>
  
  using std::cout;
  using std::list;
Simple merge
Simple merge
index f5ac3ca64bff3f2b39bc939233b1c29c7aabafe9,f3cbb504f0b874b9d5ef97b65d681b2e91ff33f3..c941248bf01fa485302d070c54b6a48ea7bb261a
  
  using std::ostream;
  
--namespace libdcp {
++namespace dcp {
        
  ostream&
 -operator<< (ostream& s, libdcp::Size const & t)
 +operator<< (ostream& s, dcp::Size const & t)
  {
        s << t.width << "x" << t.height;
        return s;