Fix seconds_to_approximate_hms sometimes saying things like 1h60m (#1314).
[dcpomatic.git] / test / dcp_subtitle_test.cc
index 927b8be69c32d28c6ebfb594006693f30abfea4c..407ac26164e405cc674c0b349f4c4dcd7869f5ee 100644 (file)
@@ -47,7 +47,13 @@ optional<ContentTextSubtitle> 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<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
@@ -82,7 +89,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test)
        film->examine_and_add_content (content);
        wait_for_jobs ();
 
-       shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, film->log()));
+       shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, film->log(), false));
        decoder->subtitle->TextStart.connect (bind (store, _1));
 
        stored = optional<ContentTextSubtitle> ();