From 2603a529a05905f133bd52271fb1298e9a4a4aa5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 10 Nov 2023 23:51:46 +0100 Subject: Always add a font with an empty ID (#2649). It's not just subtitle files with no that can have subtitles without a specified font. In particular, DoM makes a single space subtitle with no font spec when it creates filler subtitles in multi-reel DCPs. --- src/lib/dcp_examiner.cc | 4 +--- src/lib/dcp_subtitle_content.cc | 4 +--- src/lib/font_id_allocator.cc | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index 0f9ae9544..ca77f2db3 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -211,9 +211,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) for (auto const& font: asset->font_data()) { _fonts.push_back({reel_index, asset->id(), make_shared(font.first, font.second)}); } - if (asset->font_data().empty()) { - _fonts.push_back({reel_index, asset->id(), make_shared("")}); - } + _fonts.push_back({reel_index, asset->id(), make_shared("")}); } _text_count[TextType::CLOSED_CAPTION] = std::max(_text_count[TextType::CLOSED_CAPTION], static_cast(reel->closed_captions().size())); diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index e9db5546c..b3e24d5e2 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -84,9 +84,7 @@ DCPSubtitleContent::examine (shared_ptr film, shared_ptr job) } } - if (only_text()->fonts().empty()) { - only_text()->add_font(make_shared("")); - } + only_text()->add_font(make_shared("")); } DCPTime diff --git a/src/lib/font_id_allocator.cc b/src/lib/font_id_allocator.cc index ef25dc642..70eda2b06 100644 --- a/src/lib/font_id_allocator.cc +++ b/src/lib/font_id_allocator.cc @@ -63,9 +63,7 @@ FontIDAllocator::add_fonts_from_asset(int reel_index, shared_ptrid(), font.first)] = 0; } - if (asset->font_data().empty()) { - _map[Font(reel_index, asset->id(), "")] = 0; - } + _map[Font(reel_index, asset->id(), "")] = 0; } -- cgit v1.2.3