Bump libdcp for fix to crash with interop subtitles (#2536).
[dcpomatic.git] / test / 2536_regression_test.cc
1 /*
2     Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
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.
10
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.
15
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/>.
18
19 */
20
21
22 #include "lib/content_factory.h"
23 #include "lib/dcp_content.h"
24 #include "lib/film.h"
25 #include "lib/image.h"
26 #include "lib/player.h"
27 #include "lib/text_content.h"
28 #include "test.h"
29 #include <boost/test/unit_test.hpp>
30
31
32 using std::make_shared;
33
34
35 BOOST_AUTO_TEST_CASE(crash_rendering_vf_interop_subs_test)
36 {
37         auto prefix = std::string("crash_rendering_vf_interop_subs_test");
38
39         auto video = content_factory("test/data/flat_red.png");
40         auto ov = new_test_film2(prefix + "_ov", video);
41         ov->set_interop(true);
42
43         make_and_verify_dcp(
44                 ov,
45                 {
46                         dcp::VerificationNote::Code::INVALID_STANDARD,
47                 });
48
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
57         make_and_verify_dcp(
58                 vf,
59                 {
60                         dcp::VerificationNote::Code::INVALID_STANDARD,
61                         dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
62                         dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
63                         dcp::VerificationNote::Code::EXTERNAL_ASSET,
64                 });
65
66         auto vf_dcp = make_shared<DCPContent>(vf->dir(vf->dcp_name()));
67         vf_dcp->add_ov(ov->dir(ov->dcp_name()));
68         auto test = new_test_film2(prefix + "_test", { vf_dcp });
69         vf_dcp->text[0]->set_use(true);
70
71         auto player = make_shared<Player>(test, Image::Alignment::COMPACT);
72         player->set_always_burn_open_subtitles();
73         while (!player->pass()) {}
74 }
75