X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fwriter.cc;h=0285255e0d03be981101c40c0cb3770b5879d3e2;hb=0d9831021c7dc508bc69f7bd759dacd50ccb2766;hp=54e7473e88e61c92313a0af3d2ad7ddadc56f523;hpb=ef31a94cd00dcc88fc83093cbc709b5b79acc4b6;p=dcpomatic.git diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 54e7473e8..0285255e0 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -622,13 +622,23 @@ Writer::finish (boost::filesystem::path output_dcp) cpl->set_full_content_title_text (film()->name()); cpl->set_full_content_title_text_language (film()->name_language()); - cpl->set_release_territory (film()->release_territory()); + if (film()->release_territory()) { + cpl->set_release_territory (*film()->release_territory()); + } cpl->set_version_number (film()->version_number()); cpl->set_status (film()->status()); - cpl->set_chain (film()->chain()); - cpl->set_distributor (film()->distributor()); - cpl->set_facility (film()->facility()); - cpl->set_luminance (film()->luminance()); + if (film()->chain()) { + cpl->set_chain (*film()->chain()); + } + if (film()->distributor()) { + cpl->set_distributor (*film()->distributor()); + } + if (film()->facility()) { + cpl->set_facility (*film()->facility()); + } + if (film()->luminance()) { + cpl->set_luminance (*film()->luminance()); + } auto ac = film()->mapped_audio_channels(); dcp::MCASoundField field = ( @@ -653,9 +663,9 @@ Writer::finish (boost::filesystem::path output_dcp) cpl->set_main_picture_active_area (active_area); } - vector sl = film()->subtitle_languages(); - if (sl.size() > 1) { - cpl->set_additional_subtitle_languages(std::vector(sl.begin() + 1, sl.end())); + auto sl = film()->subtitle_languages().second; + if (!sl.empty()) { + cpl->set_additional_subtitle_languages(sl); } auto signer = Config::instance()->signer_chain(); @@ -696,13 +706,19 @@ Writer::write_cover_sheet (boost::filesystem::path output_dcp) boost::algorithm::replace_all (text, "$CPL_NAME", film()->name()); boost::algorithm::replace_all (text, "$TYPE", film()->dcp_content_type()->pretty_name()); boost::algorithm::replace_all (text, "$CONTAINER", film()->container()->container_nickname()); - boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", film()->isdcf_metadata().audio_language); + + auto audio_languages = film()->audio_languages(); + if (!audio_languages.empty()) { + boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", audio_languages.front().description()); + } else { + boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", _("None")); + } auto subtitle_languages = film()->subtitle_languages(); - if (subtitle_languages.empty()) { - boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", "None"); + if (subtitle_languages.first) { + boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_languages.first->description()); } else { - boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_languages.front().description()); + boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", _("None")); } boost::uintmax_t size = 0;