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. --- test/subtitle_language_test.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'test/subtitle_language_test.cc') diff --git a/test/subtitle_language_test.cc b/test/subtitle_language_test.cc index f0f2ad162..af5dee001 100644 --- a/test/subtitle_language_test.cc +++ b/test/subtitle_language_test.cc @@ -18,13 +18,16 @@ */ + /** @file test/subtitle_language_test.cc * @brief Test that subtitle language information is correctly written to DCPs. */ +#include "lib/content.h" #include "lib/content_factory.h" #include "lib/film.h" +#include "lib/text_content.h" #include "test.h" #include #include @@ -39,12 +42,10 @@ using std::shared_ptr; BOOST_AUTO_TEST_CASE (subtitle_language_interop_test) { string const name = "subtitle_language_interop_test"; - auto film = new_test_film2 (name, { content_factory("test/data/frames.srt").front() }); + auto fr = content_factory("test/data/frames.srt").front(); + auto film = new_test_film2 (name, { fr }); - vector langs = { - dcp::LanguageTag("fr-FR"), dcp::LanguageTag("de-DE") - }; - film->set_subtitle_languages(langs); + fr->only_text()->set_language (dcp::LanguageTag("fr-FR")); film->set_interop (true); make_and_verify_dcp ( @@ -62,12 +63,10 @@ BOOST_AUTO_TEST_CASE (subtitle_language_interop_test) BOOST_AUTO_TEST_CASE (subtitle_language_smpte_test) { string const name = "subtitle_language_smpte_test"; - auto film = new_test_film2 (name, { content_factory("test/data/frames.srt").front() }); + auto fr = content_factory("test/data/frames.srt").front(); + auto film = new_test_film2 (name, { fr }); - vector langs = { - dcp::LanguageTag("fr-FR"), dcp::LanguageTag("de-DE") - }; - film->set_subtitle_languages (langs); + fr->only_text()->set_language (dcp::LanguageTag("fr-FR")); film->set_interop (false); make_and_verify_dcp ( -- cgit v1.2.3