X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=test%2Fvf_test.cc;h=3389e83be0063104f7d5833827da1b77e79887f4;hp=4db48dd60071c83b5838323169eb4c16e361a26f;hb=fa85cc6352a2f25bdd1d4421c9490f9fca266e04;hpb=952084c4221c5708e02c783284cf0f7239c6b4c4 diff --git a/test/vf_test.cc b/test/vf_test.cc index 4db48dd60..3389e83be 100644 --- a/test/vf_test.cc +++ b/test/vf_test.cc @@ -25,14 +25,14 @@ */ -#include "lib/film.h" -#include "lib/dcp_content.h" -#include "lib/ffmpeg_content.h" #include "lib/content_factory.h" +#include "lib/dcp_content.h" #include "lib/dcp_content_type.h" -#include "lib/video_content.h" -#include "lib/referenced_reel_asset.h" +#include "lib/ffmpeg_content.h" +#include "lib/film.h" #include "lib/player.h" +#include "lib/referenced_reel_asset.h" +#include "lib/video_content.h" #include "test.h" #include #include @@ -42,12 +42,12 @@ #include -using std::list; -using std::string; using std::cout; -using std::shared_ptr; -using std::make_shared; using std::dynamic_pointer_cast; +using std::list; +using std::make_shared; +using std::shared_ptr; +using std::string; using namespace dcpomatic; @@ -370,3 +370,31 @@ BOOST_AUTO_TEST_CASE (vf_test7) vf->write_metadata (); make_and_verify_dcp (vf); } + + +/** Test bug #2116 */ +BOOST_AUTO_TEST_CASE (test_vf_with_trimmed_multi_reel_dcp) +{ + /* Make an OV with 3 reels */ + std::vector> ov_content; + for (int i = 0; i < 3; ++i) { + auto c = content_factory("test/data/flat_red.png").front(); + c->video->set_length(240); + ov_content.push_back(c); + } + auto ov = new_test_film2 ("test_vf_with_trimmed_multi_reel_dcp_ov", ov_content); + ov->set_reel_type(ReelType::BY_VIDEO_CONTENT); + make_and_verify_dcp (ov); + + /* Make a VF with a specific arrangement */ + auto vf_image = content_factory("test/data/flat_red.png").front(); + auto vf_dcp = make_shared(ov->dir(ov->dcp_name())); + auto vf = new_test_film2 ("test_vf_with_trimmed_multi_reel_dcp_vf", { vf_image, vf_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_position(vf, DCPTime::from_seconds(10)); + make_and_verify_dcp (vf, { dcp::VerificationNote::Code::EXTERNAL_ASSET }); +} +