Add -x32/-x64 suffix to boost libraries when building for Windows.
[dcpomatic.git] / test / time_calculation_test.cc
index c0a75d0fc40a4759f8ee1c52f68a0158f31c1c2b..4ab5d0942923e55733cabc5045dfc7fcd7fcf949 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-    Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
     This file is part of DCP-o-matic.
 
 
 */
 
 
 */
 
+
 /** @file  test/time_calculation_test.cc
  *  @brief Test calculation of timings when frame rates change.
 /** @file  test/time_calculation_test.cc
  *  @brief Test calculation of timings when frame rates change.
- *  @ingroup specific
+ *  @ingroup feature
  */
 
  */
 
+
 #include "lib/film.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/video_content.h"
 #include "lib/film.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/video_content.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 
-using std::string;
+
 using std::list;
 using std::list;
-using boost::shared_ptr;
+using std::make_shared;
+using std::string;
+using namespace dcpomatic;
+
 
 static string const xml = "<Content>"
        "<Type>FFmpeg</Type>"
 
 static string const xml = "<Content>"
        "<Type>FFmpeg</Type>"
@@ -124,31 +129,32 @@ static string const xml = "<Content>"
        "<FirstVideo>0</FirstVideo>"
        "</Content>";
 
        "<FirstVideo>0</FirstVideo>"
        "</Content>";
 
+
 BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 {
 BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 {
-       shared_ptr<Film> film = new_test_film ("ffmpeg_time_calculation_test");
+       auto film = new_test_film ("ffmpeg_time_calculation_test");
 
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
 
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
 
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 24.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 24.0).get());
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 30.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 30.0).get());
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() / 25.0).get());
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(content->video->length() * (50.0 / 60) / 25.0).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(content->video->length() * (50.0 / 60) / 25.0).get());
 
        /* Make the content audio-only */
        content->video.reset ();
 
        /* Make the content audio-only */
        content->video.reset ();
@@ -156,60 +162,61 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
        /* 24fps content, 24fps DCP */
        film->set_video_frame_rate (24);
        content->set_video_frame_rate (24);
        /* 24fps content, 24fps DCP */
        film->set_video_frame_rate (24);
        content->set_video_frame_rate (24);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
        content->set_video_frame_rate (25);
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
        content->set_video_frame_rate (25);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
-       BOOST_CHECK_SMALL (labs (content->full_length().get() - DCPTime::from_seconds(25.0 / 24).get()), 2L);
+       BOOST_CHECK_SMALL (labs (content->full_length(film).get() - DCPTime::from_seconds(25.0 / 24).get()), 2L);
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(25.0 / 30).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(25.0 / 30).get());
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(1).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(1).get());
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
-       BOOST_CHECK_EQUAL (content->full_length().get(), DCPTime::from_seconds(50.0 / 60).get());
+       BOOST_CHECK_EQUAL (content->full_length(film).get(), DCPTime::from_seconds(50.0 / 60).get());
 
 }
 
 
 }
 
+
 /** Test Player::dcp_to_content_video */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 {
 /** Test Player::dcp_to_content_video */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 {
-       shared_ptr<Film> film = new_test_film ("player_time_calculation_test1");
+       auto film = new_test_film ("player_time_calculation_test1");
 
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
        film->set_sequence (false);
        film->add_content (content);
 
        film->set_sequence (false);
        film->add_content (content);
 
-       shared_ptr<Player> player (new Player (film, film->playlist ()));
+       auto player = make_shared<Player>(film, Image::Alignment::COMPACT);
 
        /* Position 0, no trim, content rate = DCP rate */
 
        /* Position 0, no trim, content rate = DCP rate */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
-       shared_ptr<Piece> piece = player->_pieces.front ();
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
+       auto piece = player->_pieces.front();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.5)), 12);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate = DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.5)), 12);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
@@ -218,12 +225,12 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
@@ -235,24 +242,24 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.6)), 15);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 75);
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.6)), 15);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 75);
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.60)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.60)),   0);
@@ -264,18 +271,18 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           so it's 1.6s at 24fps.  Note that trims are rounded to the nearest video frame, so
           some of these results are not quite what you'd perhaps expect.
         */
           so it's 1.6s at 24fps.  Note that trims are rounded to the nearest video frame, so
           some of these results are not quite what you'd perhaps expect.
         */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.60)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.60)),   0);
-       BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.00)),  39);
-       BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (4.60)),  79);
-       BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 207);
+       BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.00)),  38);
+       BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (4.60)),  78);
+       BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 206);
 
        /* Position 0, no trim, content rate 24, DCP rate 48
           Now, for example, a DCPTime position of 3s means 3s at 48fps.  Since we run the video
 
        /* Position 0, no trim, content rate 24, DCP rate 48
           Now, for example, a DCPTime position of 3s means 3s at 48fps.  Since we run the video
@@ -283,24 +290,24 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.5)), 12);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.5)), 12);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
@@ -309,12 +316,12 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 162);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
@@ -327,24 +334,24 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.5)), 24);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 144);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.5)), 24);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 144);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
@@ -353,12 +360,12 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 324);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 324);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.50)),   0);
@@ -367,12 +374,12 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 396);
 
        /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 396);
 
        /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
-       content->set_position (DCPTime::from_seconds (0));
+       content->set_position (film, DCPTime::from_seconds(0));
        content->set_trim_start (ContentTime::from_seconds (0));
        content->set_video_frame_rate (29.9978733);
        film->set_video_frame_rate (30);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (0));
        content->set_video_frame_rate (29.9978733);
        film->set_video_frame_rate (30);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime (3200)), 1);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime (3200)), 1);
@@ -385,49 +392,49 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 /** Test Player::content_video_to_dcp */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 {
 /** Test Player::content_video_to_dcp */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 {
-       shared_ptr<Film> film = new_test_film ("player_time_calculation_test2");
+       auto film = new_test_film ("player_time_calculation_test2");
 
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
        film->set_sequence (false);
        film->add_content (content);
 
        film->set_sequence (false);
        film->add_content (content);
 
-       shared_ptr<Player> player (new Player (film, film->playlist ()));
+       auto player = make_shared<Player>(film, Image::Alignment::COMPACT);
 
        /* Position 0, no trim, content rate = DCP rate */
 
        /* Position 0, no trim, content rate = DCP rate */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
-       shared_ptr<Piece> piece = player->_pieces.front ();
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
+       auto piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 12).get(), DCPTime::from_seconds(0.5).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate = DCP rate */
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 12).get(), DCPTime::from_seconds(0.5).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(4.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(4.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(1.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(3.00).get());
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(1.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(3.00).get());
@@ -438,41 +445,41 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
           Now, for example, a DCPTime position of 3s means 3s at 25fps.  Since we run the video
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 15).get(), DCPTime::from_seconds(0.6).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 75).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 15).get(), DCPTime::from_seconds(0.6).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 75).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 40).get(), DCPTime::from_seconds(4.60).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 169).get(), DCPTime::from_seconds(9.76).get());
 
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, so the 1.6s trim is at 24fps */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 40).get(), DCPTime::from_seconds(4.60).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 169).get(), DCPTime::from_seconds(9.76).get());
 
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, so the 1.6s trim is at 24fps */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        piece = player->_pieces.front ();
-       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 138240);
-       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 40).get(), 291840);
-       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 80).get(), 445440);
-       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 209).get(), 940800);
+       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 142080);
+       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 40).get(), 295680);
+       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 80).get(), 449280);
+       BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 209).get(), 944640);
 
        /* Position 0, no trim, content rate 24, DCP rate 48
           Now, for example, a DCPTime position of 3s means 3s at 48fps.  Since we run the video
 
        /* Position 0, no trim, content rate 24, DCP rate 48
           Now, for example, a DCPTime position of 3s means 3s at 48fps.  Since we run the video
@@ -480,36 +487,36 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
           be used to make 3 * 48 frames of DCP video.  The results should be the same as the
           content rate = DCP rate case.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 12).get(), DCPTime::from_seconds(0.5).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 12).get(), DCPTime::from_seconds(0.5).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(4.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(4.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 162).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(1.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(3.00).get());
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(1.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 36).get(), DCPTime::from_seconds(3.00).get());
@@ -521,36 +528,36 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
           with skipped frames in this case, 3 * 48 frames of content video will
           be used to make 3 * 24 frames of DCP video.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 24).get(), DCPTime::from_seconds(0.5).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 144).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), 0);
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 24).get(), DCPTime::from_seconds(0.5).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 144).get(), DCPTime::from_seconds(3.0).get());
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(4.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 324).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(3.00).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(4.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 324).get(), DCPTime::from_seconds(9.75).get());
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(1.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(3.00).get());
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 0).get(), DCPTime::from_seconds(1.50).get());
        BOOST_CHECK_EQUAL (player->content_video_to_dcp(piece, 72).get(), DCPTime::from_seconds(3.00).get());
@@ -561,40 +568,40 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 /** Test Player::dcp_to_content_audio */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 {
 /** Test Player::dcp_to_content_audio */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 {
-       shared_ptr<Film> film = new_test_film ("player_time_calculation_test3");
+       auto film = new_test_film ("player_time_calculation_test3");
 
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
-       AudioStreamPtr stream = content->audio->streams().front();
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
+       auto stream = content->audio->streams().front();
        film->set_sequence (false);
        film->add_content (content);
 
        film->set_sequence (false);
        film->add_content (content);
 
-       shared_ptr<Player> player (new Player (film, film->playlist ()));
+       auto player = make_shared<Player>(film, Image::Alignment::COMPACT);
 
        /* Position 0, no trim, video/audio content rate = video/audio DCP rate */
 
        /* Position 0, no trim, video/audio content rate = video/audio DCP rate */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
-       shared_ptr<Piece> piece = player->_pieces.front ();
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
+       auto piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
@@ -603,13 +610,13 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
@@ -618,26 +625,26 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.6)),  28800);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content video rate 24, DCP rate 25, both audio rates still 48k. */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.6)),  28800);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content video rate 24, DCP rate 25, both audio rates still 48k. */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.60)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.60)),      0);
@@ -648,45 +655,45 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, both audio rates still 48k.
           1s of content is 46080 samples after resampling.
        */
        /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, both audio rates still 48k.
           1s of content is 46080 samples after resampling.
        */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.6));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.60)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.60)),      0);
-       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.00)),  74880);
-       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (4.60)), 151680);
-       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 398880);
+       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.00)),  72960);
+       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (4.60)), 149760);
+       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396960);
 
        /* Position 0, no trim, content rate 24, DCP rate 48, both audio rates still 48k.
           Now, for example, a DCPTime position of 3s means 3s at 48fps.  Since we run the video
           with repeated frames in this case, audio samples will map straight through.
           The results should be the same as the content rate = DCP rate case.
        */
 
        /* Position 0, no trim, content rate 24, DCP rate 48, both audio rates still 48k.
           Now, for example, a DCPTime position of 3s means 3s at 48fps.  Since we run the video
           with repeated frames in this case, audio samples will map straight through.
           The results should be the same as the content rate = DCP rate case.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
@@ -695,13 +702,13 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),   0);
@@ -713,26 +720,26 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
           Now, for example, a DCPTime position of 3s means 3s at 24fps.  Since we run the video
           with skipped frames in this case, audio samples should map straight through.
        */
           Now, for example, a DCPTime position of 3s means 3s at 24fps.  Since we run the video
           with skipped frames in this case, audio samples should map straight through.
        */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
@@ -741,13 +748,13 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),   0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),   0);
@@ -756,26 +763,26 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
-       content->set_position (DCPTime ());
+       content->set_position (film, DCPTime());
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
 
        /* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
        content->set_trim_start (ContentTime ());
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
@@ -784,13 +791,13 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video content rate = video DCP rate, content audio rate = 44.1k */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 324000);
 
        /* Position 3s, 1.5s trim, video content rate = video DCP rate, content audio rate = 44.1k */
-       content->set_position (DCPTime::from_seconds (3));
+       content->set_position (film, DCPTime::from_seconds(3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (1.5));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
        piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.50)),      0);
@@ -799,13 +806,13 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Check with a large start trim */
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (9.75)), 396000);
 
        /* Check with a large start trim */
-       content->set_position (DCPTime::from_seconds (0));
+       content->set_position (film, DCPTime::from_seconds(0));
        content->set_trim_start (ContentTime::from_seconds (54143));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        content->set_trim_start (ContentTime::from_seconds (54143));
        content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
-       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+       BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
        piece = player->_pieces.front ();
        piece = player->_pieces.front ();
-       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 54143L * 48000);
+       BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 54143LL * 48000);
 }
 }