From 89439cce043e5139617f6dfb948bb5d3d9cd6e70 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 1 Oct 2025 23:10:51 +0200 Subject: Fixes for rendering main captions and closed subtitles. --- src/lib/dcp_decoder.cc | 10 ++++++++++ src/lib/font_id_allocator.cc | 12 ++++++++++++ 2 files changed, 22 insertions(+) (limited to 'src/lib') diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index eda410564..42119a041 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -300,6 +300,16 @@ DCPDecoder::pass_texts(ContentTime next, dcp::Size size) ++decoder; } + if ((*_reel)->main_caption()) { + pass_texts(next, (*_reel)->main_caption(), TextType::OPEN_CAPTION, *decoder, size); + ++decoder; + } + + for (auto i: (*_reel)->closed_subtitles()) { + pass_texts(next, i, TextType::CLOSED_SUBTITLE, *decoder, size); + ++decoder; + } + for (auto i: (*_reel)->closed_captions()) { pass_texts(next, i, TextType::CLOSED_CAPTION, *decoder, size); ++decoder; diff --git a/src/lib/font_id_allocator.cc b/src/lib/font_id_allocator.cc index 902d76be6..4738eefe6 100644 --- a/src/lib/font_id_allocator.cc +++ b/src/lib/font_id_allocator.cc @@ -47,6 +47,18 @@ FontIDAllocator::add_fonts_from_reels(vector> const& reels } } + if (auto sub = reel->main_caption()) { + if (sub->asset_ref().resolved()) { + add_fonts_from_asset(reel_index, sub->asset()); + } + } + + for (auto ccap: reel->closed_subtitles()) { + if (ccap->asset_ref().resolved()) { + add_fonts_from_asset(reel_index, ccap->asset()); + } + } + for (auto ccap: reel->closed_captions()) { if (ccap->asset_ref().resolved()) { add_fonts_from_asset(reel_index, ccap->asset()); -- cgit v1.2.3