diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-05-11 13:50:57 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-05-12 22:11:06 +0200 |
| commit | 83d63bb331190db4372de4d0aaf8413c51f1eee4 (patch) | |
| tree | 1fed31a4b045fb1d586b2db445474d2d923b7845 /src/lib/reel_writer.cc | |
| parent | ff02c27b53222592e394d7cde1c904b27a211488 (diff) | |
Handle fonts for ccaps coming from DCP content (#2525).
Not dealing with them calls all sort of chaos as described in the
bug report.
Diffstat (limited to 'src/lib/reel_writer.cc')
| -rw-r--r-- | src/lib/reel_writer.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 5d9f4dae0..139c5aed4 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -491,18 +491,17 @@ maybe_add_text ( shared_ptr<Result> reel_asset; if (asset) { - if (!std::is_same<Result, dcp::ReelClosedCaptionAsset>::value) { - if (film->interop()) { - if (chosen_interop_font) { - /* We only add one font, as Interop will ignore subsequent ones (and some validators will - * complain if they are even present) - */ - asset->add_font(fonts.get(chosen_interop_font), chosen_interop_font->data().get_value_or(default_font)); - } + if (film->interop()) { + if (chosen_interop_font) { + /* We only add one font, as Interop will ignore subsequent ones (and some validators will + * complain if they are even present) + */ + asset->add_font(fonts.get(chosen_interop_font), chosen_interop_font->data().get_value_or(default_font)); } else { - for (auto const& font: fonts.map()) { - asset->add_font(font.second, font.first->data().get_value_or(default_font)); - } + } + } else { + for (auto const& font: fonts.map()) { + asset->add_font(font.second, font.first->data().get_value_or(default_font)); } } @@ -979,9 +978,7 @@ ReelWriter::write (PlayerText subs, TextType type, optional<DCPTextTrack> track, i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), tcr)); i.set_v_position(convert_vertical_position(i, film()->interop() ? dcp::SubtitleStandard::INTEROP : dcp::SubtitleStandard::SMPTE_2014)); auto sub = make_shared<dcp::SubtitleString>(i); - if (type == TextType::OPEN_SUBTITLE) { - sub->set_font(fonts.get(i.font)); - } + sub->set_font(fonts.get(i.font)); asset->add(sub); } |
