From: Carl Hetherington Date: Fri, 28 Jun 2024 11:04:30 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/main' into v2.17.x X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=d70f72ad7b25f5b71e8c27381e8bfdce6c0fa5b4;p=dcpomatic.git Merge remote-tracking branch 'origin/main' into v2.17.x --- d70f72ad7b25f5b71e8c27381e8bfdce6c0fa5b4 diff --cc cscript index baece29e1,169598569..c5e2df9e9 --- a/cscript +++ b/cscript @@@ -533,7 -523,19 +533,7 @@@ def make_spec(filename, version, target print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f) def dependencies(target, options): - deps = [('libdcp', 'v1.9.9', {'c++17': target.platform == 'osx'})] - - if target.platform == 'linux': - ffmpeg_options = { 'shared': False } - else: - ffmpeg_options = {} - - if target.platform != 'linux' or target.distro != 'arch': - deps = [('ffmpeg', '7276e269a93c2ae30e302c34708e8095ac5475e8', ffmpeg_options)] - else: - # Use distro-provided FFmpeg on Arch - deps = [] - - deps.append(('libdcp', 'v1.8.101')) ++ deps = [('libdcp', 'v1.9.10', {'c++17': target.platform == 'osx'})] deps.append(('libsub', 'v1.6.49')) deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23')) deps.append(('rtaudio', 'f619b76')) diff --cc src/lib/font_id_allocator.cc index 76b52e730,5e4ae9c0f..d5430e858 --- a/src/lib/font_id_allocator.cc +++ b/src/lib/font_id_allocator.cc @@@ -102,8 -116,10 +102,10 @@@ strin FontIDAllocator::font_id(int reel_index, string asset_id, string font_id) const { auto iter = _map.find(Font(reel_index, asset_id, font_id)); - DCPOMATIC_ASSERT(iter != _map.end()); + if (iter == _map.end()) { + return default_font_id(); + } - return String::compose("%1_%2", iter->second, font_id); + return iter->second; } diff --cc test/data index 02050bb96,6a4fa8b7c..3a3b29c0f --- a/test/data +++ b/test/data @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 02050bb9632658f0ce85ace219302b534f81eecc -Subproject commit 6a4fa8b7c13e4f09fcee995191a2c86e1eff9d6d ++Subproject commit 3a3b29c0f1e9e2654ddee2028be623e1e1b3a33f diff --cc test/subtitle_font_id_test.cc index 49ad4ea05,12d804d20..8ced35108 --- a/test/subtitle_font_id_test.cc +++ b/test/subtitle_font_id_test.cc @@@ -304,31 -303,16 +304,46 @@@ BOOST_AUTO_TEST_CASE(no_error_with_ccap } +BOOST_AUTO_TEST_CASE(subtitle_font_ids_survive_project_save) +{ + std::string const name = "subtitle_font_ids_survive_project_save"; + + auto subs = content_factory("test/data/short.srt")[0]; + auto film = new_test_film(name + "_film", { subs }); + film->set_interop(false); + make_and_verify_dcp( + film, + { + dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE, + dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME, + dcp::VerificationNote::Code::MISSING_CPL_METADATA + }); + + auto dcp = std::make_shared(film->dir(film->dcp_name())); + auto film2 = new_test_film(name + "_film2", { dcp }); + film2->write_metadata(); + + auto film3 = std::make_shared(film2->dir(".")); + film3->read_metadata(); + BOOST_REQUIRE(!film3->content().empty()); + auto check_dcp = std::dynamic_pointer_cast(film3->content()[0]); + BOOST_REQUIRE(check_dcp); + + check_dcp->check_font_ids(); +} + ++ + BOOST_AUTO_TEST_CASE(cope_with_unloaded_font_id) + { + /* This file has a with an ID that corresponds to no */ + auto subs = content_factory("test/data/unloaded_font.xml")[0]; + auto film = new_test_film2("cope_with_unloaded_font_id", { subs }); ++ + make_and_verify_dcp( + film, + { + dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE, - dcp::VerificationNote::Code::MISSING_CPL_METADATA, ++ dcp::VerificationNote::Code::MISSING_CPL_METADATA + }); + } +