diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-08-22 19:58:23 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-08-22 19:58:23 +0100 |
| commit | b626119b67727f986339203a8a34a4c843fbf068 (patch) | |
| tree | 764348aee843526ce0a3e8f76fe94e177107bce3 /src/lib | |
| parent | 429c5c9491151aa95a9a61abd5956bd6cebd4a1f (diff) | |
Fix build with multiple closed captions.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_content.cc | 3 | ||||
| -rw-r--r-- | src/lib/player.cc | 15 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 2d375cf03..a2874a604 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -600,6 +600,7 @@ bool check_text (shared_ptr<const Content> c) { return !c->text.empty(); } + bool DCPContent::can_reference_text (TextType type, string& why_not) const { @@ -620,7 +621,7 @@ DCPContent::can_reference_text (TextType type, string& why_not) const why_not = _("it does not have open subtitles in all its reels."); return false; } - if (type == TEXT_CLOSED_CAPTION && !i->closed_caption()) { + if (type == TEXT_CLOSED_CAPTION && i->closed_captions().empty()) { /// TRANSLATORS: this string will follow "Cannot reference this DCP: " why_not = _("it does not have closed captions in all its reels."); return false; diff --git a/src/lib/player.cc b/src/lib/player.cc index ce6912f0b..1e543fe1f 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -541,13 +541,14 @@ Player::get_reel_assets () } if (j->reference_text (TEXT_CLOSED_CAPTION)) { - shared_ptr<dcp::ReelAsset> ra = k->closed_caption (); - DCPOMATIC_ASSERT (ra); - ra->set_entry_point (ra->entry_point() + trim_start); - ra->set_duration (ra->duration() - trim_start - trim_end); - a.push_back ( - ReferencedReelAsset (ra, DCPTimePeriod (from, from + DCPTime::from_frames (ra->duration(), ffr))) - ); + BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> l, k->closed_captions()) { + DCPOMATIC_ASSERT (l); + l->set_entry_point (l->entry_point() + trim_start); + l->set_duration (l->duration() - trim_start - trim_end); + a.push_back ( + ReferencedReelAsset (l, DCPTimePeriod (from, from + DCPTime::from_frames (l->duration(), ffr))) + ); + } } /* Assume that main picture duration is the length of the reel */ |
