swaroop: write position file every 2 minutes; tweak play sensitivity
[dcpomatic.git] / test / dcp_subtitle_test.cc
index 5a1cf4391123eacee35b2db6e0e3b3cbeeb155c4..150cd85390e2906a53e264bc30b00625d7059ed3 100644 (file)
@@ -42,6 +42,7 @@ using std::cout;
 using std::list;
 using boost::shared_ptr;
 using boost::optional;
+using namespace dcpomatic;
 
 optional<ContentStringText> stored;
 
@@ -90,11 +91,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test)
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, false));
+       shared_ptr<DCPDecoder> decoder (new DCPDecoder (film, content, false));
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
-       while (!decoder->pass(film) && !stored) {}
+       while (!decoder->pass() && !stored) {}
 
        BOOST_REQUIRE (stored);
        BOOST_REQUIRE_EQUAL (stored->subs.size(), 2);
@@ -113,11 +114,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2)
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder(content));
+       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder(film, content));
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
-       while (!decoder->pass(film)) {
+       while (!decoder->pass()) {
                if (stored && stored->from() == ContentTime(0)) {
                        BOOST_CHECK_EQUAL (stored->subs.front().text(), "&lt;b&gt;Hello world!&lt;/b&gt;");
                }
@@ -139,9 +140,9 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3)
        film->make_dcp ();
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content));
+       shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (film, content));
        stored = optional<ContentStringText> ();
-       while (!decoder->pass (film)) {
+       while (!decoder->pass ()) {
                decoder->only_text()->PlainStart.connect (bind (store, _1));
                if (stored && stored->from() == ContentTime::from_seconds(0.08)) {
                        list<dcp::SubtitleString> s = stored->subs;