2 Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #include "lib/content_factory.h"
23 #include "lib/dcp_content.h"
25 #include "lib/image.h"
26 #include "lib/player.h"
27 #include "lib/text_content.h"
29 #include <boost/test/unit_test.hpp>
32 using std::make_shared;
35 BOOST_AUTO_TEST_CASE(crash_rendering_vf_interop_subs_test)
37 auto prefix = std::string("crash_rendering_vf_interop_subs_test");
39 auto video = content_factory("test/data/flat_red.png");
40 auto ov = new_test_film2(prefix + "_ov", video);
41 ov->set_interop(true);
46 dcp::VerificationNote::Code::INVALID_STANDARD,
49 auto ov_dcp = make_shared<DCPContent>(ov->dir(ov->dcp_name()));
50 auto subtitles = content_factory("test/data/short.srt");
51 auto vf = new_test_film2(prefix + "_vf", { ov_dcp, subtitles.front() });
52 vf->set_interop(true);
53 vf->set_reel_type(ReelType::BY_VIDEO_CONTENT);
54 ov_dcp->set_reference_video(true);
55 ov_dcp->set_reference_audio(true);
56 subtitles[0]->text[0]->set_language(dcp::LanguageTag("de"));
61 dcp::VerificationNote::Code::INVALID_STANDARD,
62 dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
63 dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
64 dcp::VerificationNote::Code::EXTERNAL_ASSET,
67 auto vf_dcp = make_shared<DCPContent>(vf->dir(vf->dcp_name()));
68 vf_dcp->add_ov(ov->dir(ov->dcp_name()));
69 auto test = new_test_film2(prefix + "_test", { vf_dcp });
70 vf_dcp->text[0]->set_use(true);
72 auto player = make_shared<Player>(test, Image::Alignment::COMPACT);
73 player->set_always_burn_open_subtitles();
74 while (!player->pass()) {}