diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-10-01 23:10:51 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-10-01 23:41:24 +0200 |
| commit | 89439cce043e5139617f6dfb948bb5d3d9cd6e70 (patch) | |
| tree | f3ceb11bcb0a6f2269c293ad74080332d64936dc | |
| parent | 925c56b4f9326343d7e85927305f038b54bcd052 (diff) | |
Fixes for rendering main captions and closed subtitles.
| -rw-r--r-- | cscript | 2 | ||||
| -rw-r--r-- | src/lib/dcp_decoder.cc | 10 | ||||
| -rw-r--r-- | src/lib/font_id_allocator.cc | 12 |
3 files changed, 23 insertions, 1 deletions
@@ -502,7 +502,7 @@ def build_with_cpp17(target): def dependencies(target, options): - deps = [('libdcp', 'v1.10.30', {'c++17': build_with_cpp17(target)})] + deps = [('libdcp', 'v1.10.31', {'c++17': build_with_cpp17(target)})] deps.append(('libsub', 'v1.6.53')) deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23')) deps.append(('rtaudio', 'f619b76')) 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<shared_ptr<dcp::Reel>> 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()); |
