diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-15 21:23:33 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-15 21:23:33 +0000 |
| commit | 8353a009aae1a604251c0160193c39741c2fa27c (patch) | |
| tree | 558d2b1951f2b4f05f0ab93b46d10afd0ebee929 /test/subrip_test.cc | |
| parent | d0bca7d33b8101cd87f78d5a76b2512dea3988f8 (diff) | |
| parent | 4e5d5c7dcc6470b8dc918d03a00e30c07df60efe (diff) | |
Merge 1.0-seek and subtitle-content.
Diffstat (limited to 'test/subrip_test.cc')
| -rw-r--r-- | test/subrip_test.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/test/subrip_test.cc b/test/subrip_test.cc index 0dbf6d310..12a77c1e1 100644 --- a/test/subrip_test.cc +++ b/test/subrip_test.cc @@ -29,6 +29,7 @@ using std::list; using std::vector; using std::string; using boost::shared_ptr; +using boost::dynamic_pointer_cast; /** Test SubRip::convert_time */ BOOST_AUTO_TEST_CASE (subrip_time_test) @@ -175,15 +176,6 @@ BOOST_AUTO_TEST_CASE (subrip_parse_test) BOOST_CHECK (i == s._subtitles.end ()); } -static list<libdcp::Subtitle> subtitles; - -static void -process_subtitle (list<libdcp::Subtitle> s) -{ - subtitles = s; -} - - /** Test rendering of a SubRip subtitle */ BOOST_AUTO_TEST_CASE (subrip_render_test) { @@ -194,12 +186,11 @@ BOOST_AUTO_TEST_CASE (subrip_render_test) shared_ptr<Film> film = new_test_film ("subrip_render_test"); shared_ptr<SubRipDecoder> decoder (new SubRipDecoder (film, content)); - decoder->TextSubtitle.connect (boost::bind (&process_subtitle, _1)); - decoder->pass (); + shared_ptr<DecodedTextSubtitle> dts = dynamic_pointer_cast<DecodedTextSubtitle> (decoder->peek ()); shared_ptr<Image> image; Position<int> position; - render_subtitles (subtitles, libdcp::Size (1998, 1080), image, position); + render_subtitles (dts->subs, libdcp::Size (1998, 1080), image, position); write_image (image, "build/test/subrip_render_test.png"); check_file ("build/test/subrip_render_test.png", "test/data/subrip_render_test.png"); } |
