From: Carl Hetherington Date: Sun, 21 Feb 2021 19:26:37 +0000 (+0100) Subject: Don't create empty SMPTE subtitles files with empty X-Git-Tag: v2.15.131~6 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=f5fd225decd41e5716fcc5aaf972c3b05d114e0d Don't create empty SMPTE subtitles files with empty Files like this fail validation against the XSD. Perhaps the XSD is wrong; for now though, create an empty 1-second-long subtitle in such files. --- diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 4888a1567..136d2405e 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -790,7 +790,7 @@ ReelWriter::empty_text_asset (TextType type, optional track) const s->set_reel_number (raw_convert (_reel_index + 1)); asset = s; } else { - shared_ptr s (new dcp::SMPTESubtitleAsset ()); + auto s = make_shared(); s->set_content_title_text (film()->name()); s->set_metadata (mxf_metadata()); if (type == TextType::OPEN_SUBTITLE && !lang.empty()) { @@ -805,6 +805,29 @@ ReelWriter::empty_text_asset (TextType type, optional track) const if (film()->encrypted()) { s->set_key (film()->key()); } + s->add ( + std::make_shared( + optional(), + false, + false, + false, + dcp::Colour(), + 42, + 1.0, + dcp::Time(0, 0, 0, 0, 24), + dcp::Time(0, 0, 1, 0, 24), + 0.5, + dcp::HAlign::CENTER, + 0.5, + dcp::VAlign::CENTER, + dcp::Direction::LTR, + "", + dcp::Effect::NONE, + dcp::Colour(), + dcp::Time(), + dcp::Time() + ) + ); asset = s; }