Noisy change to get film into AudioContent::modify_trim_start().
authorCarl Hetherington <cth@carlh.net>
Tue, 22 Nov 2022 01:16:16 +0000 (02:16 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 25 Nov 2022 23:09:27 +0000 (00:09 +0100)
27 files changed:
src/lib/audio_content.cc
src/lib/audio_content.h
src/lib/content.cc
src/lib/content.h
src/lib/dcp_content.cc
src/lib/dcp_subtitle_content.cc
src/lib/ffmpeg_content.cc
src/lib/image_content.cc
src/lib/playlist.cc
src/lib/video_content.cc
src/lib/video_content.h
src/lib/video_mxf_content.cc
src/wx/content_menu.cc
src/wx/content_panel.cc
src/wx/timing_panel.cc
test/atmos_test.cc
test/audio_content_test.cc
test/content_test.cc
test/ffmpeg_decoder_error_test.cc
test/file_naming_test.cc
test/player_test.cc
test/reels_test.cc
test/silence_padding_test.cc
test/subtitle_timing_test.cc
test/time_calculation_test.cc
test/torture_test.cc
test/vf_test.cc

index e363cfebde553a6dc0826cffd9624dcd7c19ba98..05c388a3e711812dc3ad3ceef1c39d8b01002edd 100644 (file)
@@ -420,7 +420,7 @@ AudioContent::modify_position (shared_ptr<const Film> film, DCPTime& pos) const
 
 
 void
-AudioContent::modify_trim_start (ContentTime& trim) const
+AudioContent::modify_trim_start(shared_ptr<const Film> film, ContentTime& trim) const
 {
        DCPOMATIC_ASSERT (!_streams.empty());
        /* XXX: we're in trouble if streams have different rates */
index 82a9de04171ef85a6719f6e229c0451ab7088657..bd5a25b98ccd4bd102b41b5a5fb571a3fd2a3b6e 100644 (file)
@@ -101,7 +101,7 @@ public:
        void add_properties (std::shared_ptr<const Film> film, std::list<UserProperty> &) const;
 
        void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const;
-       void modify_trim_start (dcpomatic::ContentTime& pos) const;
+       void modify_trim_start(std::shared_ptr<const Film> film, dcpomatic::ContentTime& pos) const;
 
        /** @param frame frame within the whole (untrimmed) content.
         *  @param frame_rate The frame rate of the audio (it may have been resampled).
index 9969213ac62eb260aa217a727233f3c42afdecde..e77a3638ca6f2d4d73deacf7b2fb3a97f5225b71 100644 (file)
@@ -242,7 +242,7 @@ Content::set_position (shared_ptr<const Film> film, DCPTime p, bool force_emit)
 
 
 void
-Content::set_trim_start (ContentTime t)
+Content::set_trim_start(shared_ptr<const Film> film, ContentTime t)
 {
        DCPOMATIC_ASSERT (t.get() >= 0);
 
@@ -254,7 +254,7 @@ Content::set_trim_start (ContentTime t)
 
        /* See note in ::set_position */
        if (!video && audio) {
-               audio->modify_trim_start (t);
+               audio->modify_trim_start(film, t);
        }
 
        ContentChangeSignaller cc (this, ContentProperty::TRIM_START);
@@ -402,7 +402,7 @@ Content::reel_split_points (shared_ptr<const Film>) const
 
 
 void
-Content::set_video_frame_rate (double r)
+Content::set_video_frame_rate(shared_ptr<const Film> film, double r)
 {
        ContentChangeSignaller cc (this, ContentProperty::VIDEO_FRAME_RATE);
 
@@ -416,7 +416,7 @@ Content::set_video_frame_rate (double r)
 
        /* Make sure trim is still on a frame boundary */
        if (video) {
-               set_trim_start (trim_start());
+               set_trim_start(film, trim_start());
        }
 }
 
index ba4c23ddf8cbb155f745b0ff33914fd747952866..5b804b3318aabde130272ebeb55afaeb66cd948e 100644 (file)
@@ -153,7 +153,7 @@ public:
                return _position;
        }
 
-       void set_trim_start (dcpomatic::ContentTime);
+       void set_trim_start(std::shared_ptr<const Film> film, dcpomatic::ContentTime);
 
        dcpomatic::ContentTime trim_start () const {
                boost::mutex::scoped_lock lm (_mutex);
@@ -179,7 +179,7 @@ public:
                return _video_frame_rate;
        }
 
-       void set_video_frame_rate (double r);
+       void set_video_frame_rate(std::shared_ptr<const Film> film, double r);
        void unset_video_frame_rate ();
 
        double active_video_frame_rate (std::shared_ptr<const Film> film) const;
index 2bbeba8c78c11dd03cae3028f773db72854cec32..3cc724b8e16a634e5f73a0e31b10850852829da6 100644 (file)
@@ -229,7 +229,7 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
                        boost::mutex::scoped_lock lm (_mutex);
                        video = make_shared<VideoContent>(this);
                }
-               video->take_from_examiner (examiner);
+               video->take_from_examiner(film, examiner);
                set_default_colour_conversion ();
        }
 
index b111bdb2a242b9aee2ba7ecb4730a61418bd4368..8908d34e6d49a4b5d18f6fb631d55a15f6dbc7a9 100644 (file)
@@ -62,7 +62,7 @@ DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
        auto iop = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(sc);
        auto smpte = dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(sc);
        if (smpte) {
-               set_video_frame_rate (smpte->edit_rate().numerator);
+               set_video_frame_rate(film, smpte->edit_rate().numerator);
        }
 
        boost::mutex::scoped_lock lm (_mutex);
index 496ad5f1a2772574c1681becbe7e158d74151d8d..515b58cd0fbaa82eac39ec95d2194525b2f39406 100644 (file)
@@ -273,7 +273,7 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 
        if (examiner->has_video ()) {
                video.reset (new VideoContent (this));
-               video->take_from_examiner (examiner);
+               video->take_from_examiner(film, examiner);
        }
 
        auto first_path = path (0);
@@ -332,7 +332,7 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
                /* FFmpeg has detected this file as 29.97 and the examiner thinks it is using "soft" 2:3 pulldown (telecine).
                 * This means we can treat it as a 23.976fps file.
                 */
-               set_video_frame_rate (24000.0 / 1001);
+               set_video_frame_rate(film, 24000.0 / 1001);
                video->set_length (video->length() * 24.0 / 30);
        }
 }
index d8f482a3b3bcc63c38dac6264b86910cf0bfe8bc..1415fef2448fc5ad6ab1f5e033c7a35dfdc856c6 100644 (file)
@@ -136,7 +136,7 @@ ImageContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
        Content::examine (film, job);
 
        auto examiner = make_shared<ImageExaminer>(film, shared_from_this(), job);
-       video->take_from_examiner (examiner);
+       video->take_from_examiner(film, examiner);
        set_default_colour_conversion ();
 }
 
index c18a438821b9a91fd0e4e23b7d629363e81216f0..5f26b94f3dd7ee41ce3eaf7786916d3b4fa734c1 100644 (file)
@@ -234,7 +234,7 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
 
                /* ...or have a start trim which is an integer number of frames */
                auto const old_trim = content->trim_start();
-               content->set_trim_start(old_trim);
+               content->set_trim_start(film, old_trim);
                if (old_trim != content->trim_start()) {
                        string note = _("Your project contains video content whose trim was not aligned to a frame boundary.");
                        note += "  ";
index ca0076fba8784e4601f46069a0b1714f7bf36152..c10a94f43f372a4ca184ab4edddcf8577367de58 100644 (file)
@@ -305,7 +305,7 @@ VideoContent::as_xml (xmlpp::Node* node) const
 }
 
 void
-VideoContent::take_from_examiner (shared_ptr<VideoExaminer> d)
+VideoContent::take_from_examiner(shared_ptr<const Film> film, shared_ptr<VideoExaminer> d)
 {
        /* These examiner calls could call other content methods which take a lock on the mutex */
        auto const vs = d->video_size ();
@@ -332,7 +332,7 @@ VideoContent::take_from_examiner (shared_ptr<VideoExaminer> d)
        LOG_GENERAL ("Video length obtained from header as %1 frames", _length);
 
        if (d->video_frame_rate()) {
-               _parent->set_video_frame_rate (d->video_frame_rate().get());
+               _parent->set_video_frame_rate(film, d->video_frame_rate().get());
        }
 }
 
index 7214d35e40d2994b5d525c0a9120cb39a96d1905..cff141e4ed6fe371fe0b4899b675495c7aafe92f 100644 (file)
@@ -211,7 +211,7 @@ public:
 
        void set_length (Frame);
 
-       void take_from_examiner (std::shared_ptr<VideoExaminer>);
+       void take_from_examiner(std::shared_ptr<const Film> film, std::shared_ptr<VideoExaminer>);
        void add_properties (std::list<UserProperty> &) const;
 
        void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const;
index c6165172adf96995c6f76264c09da871d0300947..9adca5a2da33d40d91f5312f5ccb9918df006206 100644 (file)
@@ -94,7 +94,7 @@ VideoMXFContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 
        video.reset (new VideoContent (this));
        auto examiner = make_shared<VideoMXFExaminer>(shared_from_this());
-       video->take_from_examiner (examiner);
+       video->take_from_examiner(film, examiner);
        video->unset_colour_conversion ();
 }
 
index cae56283bbfde0673f2dd716bbfb8b0e57248aff..32a4c9ac9f30768477263995aa677f5908eaf609 100644 (file)
@@ -483,7 +483,9 @@ ContentMenu::advanced ()
        }
 
        if (dialog->video_frame_rate()) {
-               content->set_video_frame_rate(*dialog->video_frame_rate());
+               auto film = _film.lock();
+               DCPOMATIC_ASSERT(film);
+               content->set_video_frame_rate(film, *dialog->video_frame_rate());
        } else {
                content->unset_video_frame_rate();
        }
index d9400e34c504ee64081945539ba641a8422f04fb..bf02e39305146fe3d650f2fd9bd2a556add4c789 100644 (file)
@@ -660,7 +660,7 @@ ContentPanel::add_folder(boost::filesystem::path folder)
                                return;
                        }
 
-                       ic->set_video_frame_rate (frame_rate);
+                       ic->set_video_frame_rate(_film, frame_rate);
                }
 
                _film->examine_and_add_content (i);
index a78e3bdd4fe04f82bf027360cb13074b6777d48b..5b8adc4958bd7c1bb7782df49b2f32c7d5ec5d57 100644 (file)
@@ -365,7 +365,7 @@ TimingPanel::trim_start_changed ()
                }
 
                ContentTime const trim = _trim_start->get (i->video_frame_rate().get_value_or(_parent->film()->video_frame_rate()));
-               i->set_trim_start (trim);
+               i->set_trim_start(_parent->film(), trim);
        }
 
        if (ref) {
@@ -440,7 +440,7 @@ TimingPanel::trim_start_to_playhead_clicked ()
        for (auto i: _parent->selected()) {
                if (i->position() < ph && ph < i->end(film)) {
                        FrameRateChange const frc = film->active_frame_rate_change (i->position());
-                       i->set_trim_start (i->trim_start() + ContentTime (ph - i->position(), frc));
+                       i->set_trim_start(film, i->trim_start() + ContentTime(ph - i->position(), frc));
                        new_ph = i->position ();
                }
        }
index 661eca5b927b8058c762c899d8ddaf2a8d599938..ec7e9e85d89c6cbe06e6fb512118c8a1d66649b9 100644 (file)
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE (atmos_trim_test)
        auto content = content_factory(TestPaths::private_data() / "atmos_asset.mxf");
        auto film = new_test_film2 ("atmos_trim_test", content, &cl);
 
-       content[0]->set_trim_start (dcpomatic::ContentTime::from_seconds(1));
+       content[0]->set_trim_start(film, dcpomatic::ContentTime::from_seconds(1));
 
        /* Just check that the encode runs; I'm not sure how to test the MXF */
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
index 6114c6b2ce9935b27f3410ad11cacc5887687243..f2c095fabac671bc1e8b0888b83e4f7f366886dd 100644 (file)
@@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE (audio_content_fade_in_with_trim)
 
        content->audio->set_fade_in(dcpomatic::ContentTime::from_frames(2000, 48000));
        content->audio->set_fade_out(dcpomatic::ContentTime::from_frames(1000, 48000));
-       content->set_trim_start(dcpomatic::ContentTime::from_frames(5200, 48000));
+       content->set_trim_start(film, dcpomatic::ContentTime::from_frames(5200, 48000));
 
        /* In the trim */
        auto const f1 = content->audio->fade(stream, 0, 2000, 48000);
@@ -194,7 +194,7 @@ BOOST_AUTO_TEST_CASE (audio_content_fade_out_with_trim)
 
        content->audio->set_fade_in(dcpomatic::ContentTime::from_frames(2000, 48000));
        content->audio->set_fade_out(dcpomatic::ContentTime::from_frames(1000, 48000));
-       content->set_trim_start(dcpomatic::ContentTime::from_frames(5200, 48000));
+       content->set_trim_start(film, dcpomatic::ContentTime::from_frames(5200, 48000));
        content->set_trim_end(dcpomatic::ContentTime::from_frames(9000, 48000));
 
        /* In the trim */
index 9e33225f0a30fbdafc396b8594f265694ca6e68b..12e653875a43d7e3587d81d5a46d7a4076e641b7 100644 (file)
@@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE (content_test2)
 {
        auto content = content_factory("test/data/red_23976.mp4")[0];
        auto film = new_test_film2 ("content_test2", {content});
-       content->set_trim_start(ContentTime::from_seconds(0.5));
+       content->set_trim_start(film, ContentTime::from_seconds(0.5));
        make_and_verify_dcp (film);
 }
 
@@ -81,15 +81,15 @@ BOOST_AUTO_TEST_CASE (content_test3)
        /* Trim */
 
        /* 12 frames */
-       content->set_trim_start (ContentTime::from_seconds (12.0 / 24.0));
+       content->set_trim_start(film, ContentTime::from_seconds (12.0 / 24.0));
        BOOST_CHECK (content->trim_start() == ContentTime::from_seconds (12.0 / 24.0));
 
        /* 11.2 frames */
-       content->set_trim_start (ContentTime::from_seconds (11.2 / 24.0));
+       content->set_trim_start(film, ContentTime::from_seconds (11.2 / 24.0));
        BOOST_CHECK (content->trim_start() == ContentTime::from_seconds (11.0 / 24.0));
 
        /* 13.9 frames */
-       content->set_trim_start (ContentTime::from_seconds (13.9 / 24.0));
+       content->set_trim_start(film, ContentTime::from_seconds (13.9 / 24.0));
        BOOST_CHECK (content->trim_start() == ContentTime::from_seconds (14.0 / 24.0));
 
        /* Position */
@@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE (content_test3)
        content->set_position (film, DCPTime::from_seconds(13.9 / 24.0));
        BOOST_CHECK (content->position() == DCPTime::from_seconds (14.0 / 24.0));
 
-       content->set_video_frame_rate (25);
+       content->set_video_frame_rate(film, 25);
 
        /* Check that trim is fixed when the content's video frame rate is `forced' */
 
index 3c9b3457d342f20a7dbdad09ec2a09fdadfbbc41..2774d0ef4c22276e5342e6e1c1ddcfaab46bb1a3 100644 (file)
@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE (check_exception_during_flush)
        auto content = content_factory(TestPaths::private_data() / "3d_thx_broadway_2010_lossless.m2ts");
        auto film = new_test_film2 ("check_exception_during_flush", content);
 
-       content[0]->set_trim_start(dcpomatic::ContentTime(2310308));
+       content[0]->set_trim_start(film, dcpomatic::ContentTime(2310308));
        content[0]->set_trim_end(dcpomatic::ContentTime(116020));
 
        make_and_verify_dcp (film);
index 069b1d825dea998af1a69ca5f6453688b0035a88..be4856cd1bce236d5c4b2aab3dc6da1c4fc592bc 100644 (file)
@@ -80,13 +80,13 @@ BOOST_AUTO_TEST_CASE (file_naming_test)
        BOOST_REQUIRE (!wait_for_jobs());
 
        r->set_position (film, dcpomatic::DCPTime::from_seconds(0));
-       r->set_video_frame_rate (24);
+       r->set_video_frame_rate(film, 24);
        r->video->set_length (24);
        g->set_position (film, dcpomatic::DCPTime::from_seconds(1));
-       g->set_video_frame_rate (24);
+       g->set_video_frame_rate(film, 24);
        g->video->set_length (24);
        b->set_position (film, dcpomatic::DCPTime::from_seconds(2));
-       b->set_video_frame_rate (24);
+       b->set_video_frame_rate(film, 24);
        b->video->set_length (24);
 
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
@@ -139,13 +139,13 @@ BOOST_AUTO_TEST_CASE (file_naming_test2)
        BOOST_REQUIRE (!wait_for_jobs());
 
        r->set_position (film, dcpomatic::DCPTime::from_seconds(0));
-       r->set_video_frame_rate (24);
+       r->set_video_frame_rate(film, 24);
        r->video->set_length (24);
        g->set_position (film, dcpomatic::DCPTime::from_seconds(1));
-       g->set_video_frame_rate (24);
+       g->set_video_frame_rate(film, 24);
        g->video->set_length (24);
        b->set_position (film, dcpomatic::DCPTime::from_seconds(2));
-       b->set_video_frame_rate (24);
+       b->set_video_frame_rate(film, 24);
        b->video->set_length (24);
 
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
index d0460d88da1d6a455c410a6ec0a46e79dce3585d..733883b5a5fba4b6e0b58e7127f00822bb542763 100644 (file)
@@ -301,7 +301,7 @@ BOOST_AUTO_TEST_CASE (player_trim_test)
        BOOST_REQUIRE (!wait_for_jobs ());
        B->video->set_length (10 * 24);
        B->set_position (film, DCPTime::from_seconds(10));
-       B->set_trim_start (ContentTime::from_seconds (2));
+       B->set_trim_start(film, ContentTime::from_seconds(2));
 
        make_and_verify_dcp (film);
 }
@@ -368,7 +368,7 @@ BOOST_AUTO_TEST_CASE (player_trim_crash)
        /* Wait for the butler to fill */
        dcpomatic_sleep_seconds (5);
 
-       boon->set_trim_start (ContentTime::from_seconds(5));
+       boon->set_trim_start(film, ContentTime::from_seconds(5));
 
        butler->seek (DCPTime(), true);
 
@@ -387,7 +387,7 @@ BOOST_AUTO_TEST_CASE (player_silence_crash)
        film->examine_and_add_content (sine);
        BOOST_REQUIRE (!wait_for_jobs());
 
-       sine->set_video_frame_rate (23.976);
+       sine->set_video_frame_rate(film, 23.976);
        film->write_metadata ();
        make_and_verify_dcp (film, {dcp::VerificationNote::Code::MISSING_CPL_METADATA});
 }
@@ -569,7 +569,7 @@ BOOST_AUTO_TEST_CASE(trimmed_sound_mix_bug_13)
        A->audio->set_gain(-12);
        B->set_position(film, DCPTime());
        B->audio->set_gain(-12);
-       B->set_trim_start(ContentTime(13));
+       B->set_trim_start(film, ContentTime(13));
 
        make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
        check_mxf_audio_file("test/data/trimmed_sound_mix_bug_13.mxf", dcp_file(film, "pcm_"));
@@ -586,10 +586,10 @@ BOOST_AUTO_TEST_CASE(trimmed_sound_mix_bug_13_frame_rate_change)
        A->audio->set_gain(-12);
        B->set_position(film, DCPTime());
        B->audio->set_gain(-12);
-       B->set_trim_start(ContentTime(13));
+       B->set_trim_start(film, ContentTime(13));
 
-       A->set_video_frame_rate(24);
-       B->set_video_frame_rate(24);
+       A->set_video_frame_rate(film, 24);
+       B->set_video_frame_rate(film, 24);
        film->set_video_frame_rate(25);
 
        make_and_verify_dcp(film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
index 8dbfcd5ba93c8cc4bad89546b2b458d48888defb..092c206f072e1b9a58dbcacf1572e0fe177d781a 100644 (file)
@@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE (reels_test5)
        }
 
        {
-               dcp->set_trim_start (ContentTime::from_seconds (0.5));
+               dcp->set_trim_start(film, ContentTime::from_seconds(0.5));
                auto p = dcp->reels (film);
                BOOST_REQUIRE_EQUAL (p.size(), 4U);
                auto i = p.begin();
@@ -280,7 +280,7 @@ BOOST_AUTO_TEST_CASE (reels_test5)
        }
 
        {
-               dcp->set_trim_start (ContentTime::from_seconds (1.5));
+               dcp->set_trim_start(film, ContentTime::from_seconds(1.5));
                auto p = dcp->reels (film);
                BOOST_REQUIRE_EQUAL (p.size(), 3U);
                auto i = p.begin();
@@ -411,7 +411,7 @@ BOOST_AUTO_TEST_CASE (reels_test11)
        auto film = new_test_film2 ("reels_test11", {A});
        film->set_video_frame_rate (24);
        A->video->set_length (240);
-       A->set_video_frame_rate (24);
+       A->set_video_frame_rate(film, 24);
        A->set_position (film, DCPTime::from_seconds(1));
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
        make_and_verify_dcp (film);
@@ -440,11 +440,11 @@ BOOST_AUTO_TEST_CASE (reels_test12)
        film->set_sequence (false);
 
        A->video->set_length (240);
-       A->set_video_frame_rate (24);
+       A->set_video_frame_rate(film, 24);
        A->set_position (film, DCPTime::from_seconds(1));
 
        B->video->set_length (120);
-       B->set_video_frame_rate (24);
+       B->set_video_frame_rate(film, 24);
        B->set_position (film, DCPTime::from_seconds(14));
 
        auto r = film->reels ();
@@ -617,7 +617,7 @@ BOOST_AUTO_TEST_CASE (repeated_dcp_into_reels)
 
        for (int i = 0; i < 4; ++i) {
                original_dcp[i]->set_position(film2, DCPTime::from_frames(total_frames * i / 4, frame_rate));
-               original_dcp[i]->set_trim_start(ContentTime::from_frames(total_frames * i / 4, frame_rate));
+               original_dcp[i]->set_trim_start(film2, ContentTime::from_frames(total_frames * i / 4, frame_rate));
                original_dcp[i]->set_trim_end  (ContentTime::from_frames(total_frames * (4 - i - 1) / 4, frame_rate));
                original_dcp[i]->set_reference_video(true);
                original_dcp[i]->set_reference_audio(true);
index e4c640792d675bda09cfe7fd1acbe1b4c91d997f..6bcb82d0598f442a5906e0faaa904f65c3b26749 100644 (file)
@@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE (silence_padding_test2)
        auto film = new_test_film2 ("silence_padding_test2", { content }, &cl);
 
        film->set_video_frame_rate (24);
-       content->set_trim_start (dcpomatic::ContentTime(4003));
+       content->set_trim_start(film, dcpomatic::ContentTime(4003));
 
        make_and_verify_dcp (film);
 
index 68881aea89b81df332e4e11b1c6e120245f4f1e1..eec4c063981f7cc4fb48742fd401a9112139e25b 100644 (file)
@@ -43,9 +43,9 @@ BOOST_AUTO_TEST_CASE (test_subtitle_timing_with_frame_rate_change)
        auto picture = content_factory("test/data/flat_red.png")[0];
        auto sub = content_factory("test/data/hour.srt")[0];
        sub->text.front()->set_language(dcp::LanguageTag("en-GB"));
-       picture->set_video_frame_rate (content_frame_rate);
 
        auto film = new_test_film2 (name, { picture, sub });
+       picture->set_video_frame_rate(film, content_frame_rate);
        auto const dcp_frame_rate = film->video_frame_rate();
 
        make_and_verify_dcp (film, {dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K });
index 4ab5d0942923e55733cabc5045dfc7fcd7fcf949..7ace7f8c235c0eccce88b39eaa80271e1d1ba233 100644 (file)
@@ -161,11 +161,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 
        /* 24fps content, 24fps DCP */
        film->set_video_frame_rate (24);
-       content->set_video_frame_rate (24);
+       content->set_video_frame_rate(film, 24);
        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);
+       content->set_video_frame_rate(film, 25);
        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);
@@ -200,8 +200,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 0, no trim, content rate = DCP rate */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -212,8 +212,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 3s, no trim, content rate = DCP rate */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -226,8 +226,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -243,8 +243,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -255,8 +255,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -272,8 +272,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           some of these results are not quite what you'd perhaps expect.
         */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.6));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.6));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -291,8 +291,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           content rate = DCP rate case.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -303,8 +303,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -317,8 +317,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -335,8 +335,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
           be used to make 3 * 24 frames of DCP video.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (48);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -347,8 +347,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (48);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -361,8 +361,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (48);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -375,8 +375,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 
        /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
        content->set_position (film, DCPTime::from_seconds(0));
-       content->set_trim_start (ContentTime::from_seconds (0));
-       content->set_video_frame_rate (29.9978733);
+       content->set_trim_start(film, ContentTime::from_seconds (0));
+       content->set_video_frame_rate(film, 29.9978733);
        film->set_video_frame_rate (30);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -406,8 +406,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 0, no trim, content rate = DCP rate */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -418,8 +418,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 3s, no trim, content rate = DCP rate */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -430,8 +430,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 3s, 1.5s trim, content rate = DCP rate */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -446,8 +446,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           fast (at 25fps) in this case, this means 75 frames of content video will be used.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -458,8 +458,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 3s, no trim, content rate 24, DCP rate 25 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -470,8 +470,8 @@ 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 (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.6));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.6));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -488,8 +488,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           content rate = DCP rate case.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -500,8 +500,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -512,8 +512,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -529,8 +529,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
           be used to make 3 * 24 frames of DCP video.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (48);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -541,8 +541,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (48);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -553,8 +553,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (48);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 48);
        film->set_video_frame_rate (24);
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
@@ -583,8 +583,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Position 0, no trim, video/audio content rate = video/audio DCP rate */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -596,8 +596,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
        content->set_position (film, DCPTime::from_seconds (3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -611,8 +611,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
        content->set_position (film, DCPTime::from_seconds (3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -626,8 +626,8 @@ 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 (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -639,8 +639,8 @@ 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 (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -656,8 +656,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
           1s of content is 46080 samples after resampling.
        */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.6));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.6));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (25);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -675,8 +675,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
           The results should be the same as the content rate = DCP rate case.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -688,8 +688,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -703,8 +703,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -721,8 +721,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
           with skipped frames in this case, audio samples should map straight through.
        */
        content->set_position (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (48);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -734,8 +734,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Position 3s, no trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -749,8 +749,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
        content->set_position (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
@@ -764,8 +764,8 @@ 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 (film, DCPTime());
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
@@ -777,8 +777,8 @@ 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 (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime ());
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime());
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
@@ -792,8 +792,8 @@ 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 (film, DCPTime::from_seconds(3));
-       content->set_trim_start (ContentTime::from_seconds (1.5));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(1.5));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 44100;
        player->setup_pieces ();
@@ -807,8 +807,8 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 
        /* Check with a large start trim */
        content->set_position (film, DCPTime::from_seconds(0));
-       content->set_trim_start (ContentTime::from_seconds (54143));
-       content->set_video_frame_rate (24);
+       content->set_trim_start(film, ContentTime::from_seconds(54143));
+       content->set_video_frame_rate(film, 24);
        film->set_video_frame_rate (24);
        stream->_frame_rate = 48000;
        player->setup_pieces ();
index f8951932b7956f3b574539824b662c17642fcdd2..851a26a31ddadcce03ac229b259c199fffebdf0a 100644 (file)
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE (torture_test1)
        film->examine_and_add_content (staircase);
        BOOST_REQUIRE (!wait_for_jobs());
        staircase->set_position (film, DCPTime::from_frames(2000, film->audio_frame_rate()));
-       staircase->set_trim_start (ContentTime::from_frames(12, 48000));
+       staircase->set_trim_start(film, ContentTime::from_frames(12, 48000));
        staircase->set_trim_end (ContentTime::from_frames (35, 48000));
        staircase->audio->set_gain (20 * log10(2));
 
@@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE (torture_test1)
        film->examine_and_add_content (staircase);
        BOOST_REQUIRE (!wait_for_jobs());
        staircase->set_position (film, DCPTime::from_frames(50000, film->audio_frame_rate()));
-       staircase->set_trim_start (ContentTime::from_frames(12, 48000));
+       staircase->set_trim_start(film, ContentTime::from_frames(12, 48000));
        staircase->set_trim_end (ContentTime::from_frames(35, 48000));
        staircase->audio->set_gain (20 * log10(2));
 
index 32e7ae431c90062d88c877af76b62a68ccad0f80..3705635c2f2f018b6c31ea96d97b93ab2657c444 100644 (file)
@@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE (vf_test3)
        vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
        auto dcp = make_shared<DCPContent>(ov->dir(ov->dcp_name()));
        BOOST_REQUIRE (dcp);
-       dcp->set_trim_start (ContentTime::from_seconds (1));
+       dcp->set_trim_start(vf, ContentTime::from_seconds (1));
        dcp->set_trim_end (ContentTime::from_seconds (1));
        vf->examine_and_add_content (dcp);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -392,7 +392,7 @@ BOOST_AUTO_TEST_CASE (test_vf_with_trimmed_multi_reel_dcp)
        vf->set_reel_type(ReelType::BY_VIDEO_CONTENT);
        vf_dcp->set_reference_video(true);
        vf_dcp->set_reference_audio(true);
-       vf_dcp->set_trim_start(ContentTime::from_seconds(10));
+       vf_dcp->set_trim_start(vf, ContentTime::from_seconds(10));
        vf_dcp->set_position(vf, DCPTime::from_seconds(10));
        make_and_verify_dcp (vf, { dcp::VerificationNote::Code::EXTERNAL_ASSET });
 }