From e0a70cd5cfb11fc2de167f3146acdd437a6faa82 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 23 Mar 2021 00:50:11 +0100 Subject: 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. --- src/lib/subtitle_encoder.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib/subtitle_encoder.cc') 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 tr if (!_assets[_reel_index].first) { shared_ptr asset; - vector lang = _film->subtitle_languages (); + auto lang = _film->subtitle_languages (); if (_film->interop ()) { auto s = make_shared(); 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(_reel_index + 1)); _assets[_reel_index].first = s; } else { auto s = make_shared(); 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)); } -- cgit v1.2.3