diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-23 00:50:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-31 22:48:53 +0200 |
| commit | e0a70cd5cfb11fc2de167f3146acdd437a6faa82 (patch) | |
| tree | 022ceef78d7daa12bccf519ebab0db5e23a3feb6 /src/lib/writer.cc | |
| parent | 8640da877450479a85c73b2a921897d83b478c84 (diff) | |
Put subtitle language back into content from the film (#1930).
This also adds the main/additional language flag.
Of all the considerations about how to specify subtitle language,
the most important seems to be that the language specification happens
for the content where the language is; i.e. in the content text tab.
Diffstat (limited to 'src/lib/writer.cc')
| -rw-r--r-- | src/lib/writer.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 839156d34..3448c5bca 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -663,9 +663,9 @@ Writer::finish (boost::filesystem::path output_dcp) cpl->set_main_picture_active_area (active_area); } - vector<dcp::LanguageTag> sl = film()->subtitle_languages(); - if (sl.size() > 1) { - cpl->set_additional_subtitle_languages(std::vector<dcp::LanguageTag>(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(); @@ -709,10 +709,10 @@ Writer::write_cover_sheet (boost::filesystem::path output_dcp) boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", film()->isdcf_metadata().audio_language); 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; |
