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 /src | |
| parent | 925c56b4f9326343d7e85927305f038b54bcd052 (diff) | |
Fixes for rendering main captions and closed subtitles.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/dcp_decoder.cc | 10 | ||||
| -rw-r--r-- | src/lib/font_id_allocator.cc | 12 |
2 files changed, 22 insertions, 0 deletions
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()); |
