No-op; fix GPL address and use the explicit-program-name version.
[dcpomatic.git] / test / time_calculation_test.cc
index 7c8259f977454543a7e3a19885677f05b3f7bbac..3d602c0f0f87b5f316255c483c289caada4ec6aa 100644 (file)
@@ -1,19 +1,20 @@
 /*
     Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
 
-    This program is free software; you can redistribute it and/or modify
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic 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,
+    DCP-o-matic 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.
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
@@ -21,6 +22,7 @@
 #include "lib/ffmpeg_content.h"
 #include "lib/video_content.h"
 #include "lib/player.h"
+#include "lib/audio_content.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 
@@ -82,6 +84,7 @@ static string const xml = "<Content>"
        "<Name>und; 2 channels</Name>"
        "<Id>2</Id>"
        "<FrameRate>44100</FrameRate>"
+       "<Length>44100</Length>"
        "<Channels>2</Channels>"
        "<FirstAudio>0</FirstAudio>"
        "<Mapping>"
@@ -128,19 +131,44 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
-       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 25.0));
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 25.0));
        /* 25fps content, 24fps DCP; length should be increased */
        film->set_video_frame_rate (24);
-       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 24.0));
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 24.0));
        /* 25fps content, 30fps DCP; length should be decreased */
        film->set_video_frame_rate (30);
-       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 30.0));
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 30.0));
        /* 25fps content, 50fps DCP; length should be the same */
        film->set_video_frame_rate (50);
-       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 25.0));
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 25.0));
        /* 25fps content, 60fps DCP; length should be decreased */
        film->set_video_frame_rate (60);
-       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() * (50.0 / 60) / 25.0));
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() * (50.0 / 60) / 25.0));
+
+       /* Make the content audio-only */
+       content->video.reset ();
+
+       /* 24fps content, 24fps DCP */
+       film->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (1));
+       /* 25fps content, 25fps DCP */
+       film->set_video_frame_rate (25);
+       content->set_video_frame_rate (25);
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (1));
+       /* 25fps content, 24fps DCP; length should be increased */
+       film->set_video_frame_rate (24);
+       BOOST_CHECK_SMALL (abs (content->full_length().get() - DCPTime::from_seconds(25.0 / 24).get()), 2);
+       /* 25fps content, 30fps DCP; length should be decreased */
+       film->set_video_frame_rate (30);
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (25.0 / 30));
+       /* 25fps content, 50fps DCP; length should be the same */
+       film->set_video_frame_rate (50);
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (1));
+       /* 25fps content, 60fps DCP; length should be decreased */
+       film->set_video_frame_rate (60);
+       BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (50.0 / 60));
+
 }
 
 /** Test Player::dcp_to_content_video */
@@ -161,7 +189,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 0, no trim, content rate = DCP rate */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -173,7 +201,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 3s, no trim, content rate = DCP rate */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -187,7 +215,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -204,7 +232,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -216,7 +244,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -232,7 +260,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
         */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -251,7 +279,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -263,7 +291,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -277,7 +305,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -295,7 +323,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (48);
+       content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -307,7 +335,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (48);
+       content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -321,7 +349,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (48);
+       content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -335,7 +363,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
        /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
        content->set_position (DCPTime::from_seconds (0));
        content->set_trim_start (ContentTime::from_seconds (0));
-       content->video->set_video_frame_rate (29.9978733);
+       content->set_video_frame_rate (29.9978733);
        film->set_video_frame_rate (30);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -366,7 +394,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 0, no trim, content rate = DCP rate */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -378,7 +406,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 3s, no trim, content rate = DCP rate */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -390,7 +418,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -406,7 +434,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -418,7 +446,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -430,7 +458,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* 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_trim_start (ContentTime::from_seconds (1.6));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -448,7 +476,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -460,7 +488,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -472,7 +500,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -489,7 +517,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (48);
+       content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -501,7 +529,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (48);
+       content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -513,7 +541,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (48);
+       content->set_video_frame_rate (48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -534,7 +562,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        list<string> notes;
        shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
-       AudioStreamPtr stream = content->audio_streams().front();
+       AudioStreamPtr stream = content->audio->streams().front();
        film->set_sequence (false);
        film->add_content (content);
 
@@ -543,7 +571,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 0, no trim, video/audio content rate = video/audio DCP rate */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -556,7 +584,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -571,7 +599,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -586,7 +614,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -599,7 +627,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* 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_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -616,7 +644,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.6));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -635,7 +663,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -648,7 +676,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -663,7 +691,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -681,7 +709,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -694,7 +722,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -709,7 +737,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -724,7 +752,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
        content->set_position (DCPTime ());
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
@@ -737,7 +765,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
        content->set_position (DCPTime::from_seconds (3));
        content->set_trim_start (ContentTime ());
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
@@ -752,7 +780,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* 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_trim_start (ContentTime::from_seconds (1.5));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
@@ -767,7 +795,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        /* Check with a large start trim */
        content->set_position (DCPTime::from_seconds (0));
        content->set_trim_start (ContentTime::from_seconds (54143));
-       content->video->set_video_frame_rate (24);
+       content->set_video_frame_rate (24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();