diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-14 14:40:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-15 20:11:35 +0100 |
| commit | 27526b4ab45f7684bf695d5763620692381f6970 (patch) | |
| tree | 74ec8db512f8afbfe45e187f8ebb242ea0ecd1f5 | |
| parent | 450da5182c3e224af87f269c3216ac13ae39ec1f (diff) | |
Fix missing language tag in open captions.v2.18.5
| -rw-r--r-- | src/lib/reel_writer.cc | 4 | ||||
| -rw-r--r-- | test/open_caption_test.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 7bcc2d796..9037c9ef9 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -800,7 +800,7 @@ ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool if (film()->interop()) { auto s = make_shared<dcp::InteropTextAsset>(); s->set_movie_title (film()->name()); - if (type == TextType::OPEN_SUBTITLE) { + if (is_open(type)) { s->set_language (lang.first ? lang.first->to_string() : "Unknown"); } else if (track->language) { s->set_language (track->language->to_string()); @@ -811,7 +811,7 @@ ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool auto s = make_shared<dcp::SMPTETextAsset>(); s->set_content_title_text (film()->name()); s->set_metadata (mxf_metadata()); - if (type == TextType::OPEN_SUBTITLE && lang.first) { + if (is_open(type) && lang.first) { s->set_language (*lang.first); } else if (track && track->language) { s->set_language (dcp::LanguageTag(track->language->to_string())); diff --git a/test/open_caption_test.cc b/test/open_caption_test.cc index 06b08c151..d1f173062 100644 --- a/test/open_caption_test.cc +++ b/test/open_caption_test.cc @@ -32,13 +32,13 @@ BOOST_AUTO_TEST_CASE(basic_open_caption_test) auto film = new_test_film("basic_open_caption_test", { content }); content->text[0]->set_type(TextType::OPEN_CAPTION); + content->text[0]->set_language(dcp::LanguageTag("de")); make_and_verify_dcp( film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA, - dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME, - dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE + dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME } ); |
