X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fdcp_subtitle_test.cc;h=407ac26164e405cc674c0b349f4c4dcd7869f5ee;hb=a75aaf61751c65970d7c75e1d72de6512925d358;hp=92a415ae121fc309f2cc7ae0bd2e80ccee342915;hpb=67a68bd971ebe1b35daa3f75873b4ccb53c00ba0;p=dcpomatic.git diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 92a415ae1..407ac2616 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -47,7 +47,13 @@ optional stored; static void store (ContentTextSubtitle sub) { - stored = sub; + if (!stored) { + stored = sub; + } else { + BOOST_FOREACH (dcp::SubtitleString i, sub.subs) { + stored->subs.push_back (i); + } + } } /** Test pass-through of a very simple DCP subtitle file */ @@ -57,6 +63,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); + film->set_interop (false); shared_ptr content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml")); film->examine_and_add_content (content); wait_for_jobs (); @@ -82,8 +89,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test) film->examine_and_add_content (content); wait_for_jobs (); - shared_ptr decoder (new DCPDecoder (content, film->log())); - decoder->subtitle->TextData.connect (bind (store, _1)); + shared_ptr decoder (new DCPDecoder (content, film->log(), false)); + decoder->subtitle->TextStart.connect (bind (store, _1)); stored = optional (); while (!decoder->pass() && !stored) {} @@ -106,11 +113,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2) wait_for_jobs (); shared_ptr decoder (new DCPSubtitleDecoder (content, film->log())); - decoder->subtitle->TextData.connect (bind (store, _1)); + decoder->subtitle->TextStart.connect (bind (store, _1)); stored = optional (); while (!decoder->pass ()) { - if (stored && stored->period().from == ContentTime(0)) { + if (stored && stored->from() == ContentTime(0)) { BOOST_CHECK_EQUAL (stored->subs.front().text(), "<b>Hello world!</b>"); } } @@ -134,8 +141,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3) shared_ptr decoder (new DCPSubtitleDecoder (content, film->log())); stored = optional (); while (!decoder->pass ()) { - decoder->subtitle->TextData.connect (bind (store, _1)); - if (stored && stored->period().from == ContentTime::from_seconds(0.08)) { + decoder->subtitle->TextStart.connect (bind (store, _1)); + if (stored && stored->from() == ContentTime::from_seconds(0.08)) { list s = stored->subs; list::const_iterator i = s.begin (); BOOST_CHECK_EQUAL (i->text(), "This");