pair<optional<dcp::LanguageTag>, vector<dcp::LanguageTag>>
-Film::subtitle_languages () const
+Film::subtitle_languages(bool* burnt_in) const
{
+ if (burnt_in) {
+ *burnt_in = true;
+ }
+
pair<optional<dcp::LanguageTag>, vector<dcp::LanguageTag>> result;
for (auto i: content()) {
+ auto dcp = dynamic_pointer_cast<DCPContent>(i);
for (auto const& text: i->text) {
- if (text->use() && text->type() == TextType::OPEN_SUBTITLE && text->language()) {
- if (text->language_is_additional()) {
- result.second.push_back(text->language().get());
- } else {
- result.first = text->language().get();
+ auto const use = text->use() || (dcp && dcp->reference_text(TextType::OPEN_SUBTITLE));
+ if (use && text->type() == TextType::OPEN_SUBTITLE) {
+ if (!text->burn() && burnt_in) {
+ *burnt_in = false;
+ }
+ if (text->language()) {
+ if (text->language_is_additional()) {
+ result.second.push_back(text->language().get());
+ } else {
+ result.first = text->language().get();
+ }
}
}
}
isdcf_name += "_" + to_upper (audio_language);
- auto burnt_in = true;
- for (auto i: content_list) {
- for (auto text: i->text) {
- if (text->type() == TextType::OPEN_SUBTITLE && text->use() && !text->burn()) {
- burnt_in = false;
- }
- }
- }
-
- auto sub_langs = subtitle_languages();
+ bool burnt_in;
+ auto sub_langs = subtitle_languages(&burnt_in);
auto ccap_langs = closed_caption_languages();
if (sub_langs.first && sub_langs.first->language()) {
auto lang = entry_for_language(*sub_langs.first);