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/subtitle_encoder.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/subtitle_encoder.cc')
| -rw-r--r-- | src/lib/subtitle_encoder.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/subtitle_encoder.cc b/src/lib/subtitle_encoder.cc index 3721ee02b..b61876ad6 100644 --- a/src/lib/subtitle_encoder.cc +++ b/src/lib/subtitle_encoder.cc @@ -135,20 +135,20 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr if (!_assets[_reel_index].first) { shared_ptr<dcp::SubtitleAsset> asset; - vector<dcp::LanguageTag> lang = _film->subtitle_languages (); + auto lang = _film->subtitle_languages (); if (_film->interop ()) { auto s = make_shared<dcp::InteropSubtitleAsset>(); s->set_movie_title (_film->name()); - if (!lang.empty()) { - s->set_language (lang.front().to_string()); + if (lang.first) { + s->set_language (lang.first->to_string()); } s->set_reel_number (raw_convert<string>(_reel_index + 1)); _assets[_reel_index].first = s; } else { auto s = make_shared<dcp::SMPTESubtitleAsset>(); s->set_content_title_text (_film->name()); - if (!lang.empty()) { - s->set_language (lang.front()); + if (lang.first) { + s->set_language (*lang.first); } else if (!track->language.empty()) { s->set_language (dcp::LanguageTag(track->language)); } |
