- if (a) {
- a->set_annotation_text (i->first.name);
- if (!i->first.language.empty()) {
- a->set_language (dcp::LanguageTag(i->first.language));
- }
+ DCPOMATIC_ASSERT (a);
+ a->set_annotation_text (i->first.name);
+ if (!i->first.language.empty()) {
+ a->set_language (dcp::LanguageTag(i->first.language));
+ }
+
+ ensure_closed_captions.erase (i->first);
+ }
+
+ /* Make empty tracks for anything we've been asked to ensure but that we haven't added */
+ BOOST_FOREACH (DCPTextTrack i, ensure_closed_captions) {
+ shared_ptr<dcp::ReelClosedCaptionAsset> a = maybe_add_text<dcp::ReelClosedCaptionAsset> (
+ empty_text_asset(TEXT_CLOSED_CAPTION, i), duration, reel, refs, fonts, film(), _period, output_dcp, _text_only
+ );
+ DCPOMATIC_ASSERT (a);
+ a->set_annotation_text (i.name);
+ if (!i.language.empty()) {
+ a->set_language (dcp::LanguageTag(i.language));