- shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, film->log()));
-
- list<ContentTimePeriod> ctp = decoder->text_subtitles_during (
- ContentTimePeriod (
- ContentTime::from_seconds (25),
- ContentTime::from_seconds (26)
- ),
- true
- );
-
- BOOST_REQUIRE_EQUAL (ctp.size(), 2);
- BOOST_CHECK_EQUAL (ctp.front().from.get(), ContentTime::from_seconds(25 + 12 * 0.04).get());
- BOOST_CHECK_EQUAL (ctp.front().to.get(), ContentTime::from_seconds(26 + 4 * 0.04).get());
- BOOST_CHECK_EQUAL (ctp.back().from.get(), ContentTime::from_seconds(25 + 12 * 0.04).get());
- BOOST_CHECK_EQUAL (ctp.back().to.get(), ContentTime::from_seconds(26 + 4 * 0.04).get());
-
- list<ContentTextSubtitle> subs = decoder->subtitle->get_text (
- ContentTimePeriod (
- ContentTime::from_seconds (25),
- ContentTime::from_seconds (26)
- ),
- true,
- true
- );
-
- BOOST_REQUIRE_EQUAL (subs.size(), 1);
- BOOST_REQUIRE_EQUAL (subs.front().subs.size(), 2);
- BOOST_CHECK_EQUAL (subs.front().subs.front().text(), "Noch mal.");
- BOOST_CHECK_EQUAL (subs.front().subs.back().text(), "Encore une fois.");
+ shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, film->log(), false));
+ decoder->subtitle->TextStart.connect (bind (store, _1));
+
+ stored = optional<ContentTextSubtitle> ();
+ while (!decoder->pass() && !stored) {}
+
+ BOOST_REQUIRE (stored);
+ BOOST_REQUIRE_EQUAL (stored->subs.size(), 2);
+ BOOST_CHECK_EQUAL (stored->subs.front().text(), "Noch mal.");
+ BOOST_CHECK_EQUAL (stored->subs.back().text(), "Encore une fois.");