X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fplay_test.cc;h=690b042d8c32722f78e1c75e5c800e22cc685251;hb=08d62727f7f1c813cbc7041027fe4a52518623da;hp=cb5b6cbb8cd2f1ff0349a9b93b211755e3b78583;hpb=373f010a7f04add1f49169cbaa60cb7ae5f508d4;p=dcpomatic.git diff --git a/test/play_test.cc b/test/play_test.cc index cb5b6cbb8..690b042d8 100644 --- a/test/play_test.cc +++ b/test/play_test.cc @@ -34,7 +34,7 @@ struct Video { boost::shared_ptr content; boost::shared_ptr image; - Time time; + DCPTime time; }; class PlayerWrapper @@ -46,11 +46,11 @@ public: _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _2, _5)); } - void process_video (shared_ptr i, bool, Time t) + void process_video (shared_ptr i, bool, DCPTime t) { Video v; v.content = _player->_last_video; - v.image = i; + v.image = i->image (PIX_FMT_RGB24, false); v.time = t; _queue.push_front (v); } @@ -67,7 +67,7 @@ public: return v; } - void seek (Time t, bool ac) + void seek (DCPTime t, bool ac) { _player->seek (t, ac); _queue.clear (); @@ -89,25 +89,23 @@ BOOST_AUTO_TEST_CASE (play_test) film->examine_and_add_content (A); wait_for_jobs (); - BOOST_CHECK_EQUAL (A->video_length(), 16); + BOOST_CHECK_EQUAL (A->video_length().frames (24), 16); shared_ptr B (new FFmpegContent (film, "test/data/red_30.mp4")); film->examine_and_add_content (B); wait_for_jobs (); - BOOST_CHECK_EQUAL (B->video_length(), 16); + BOOST_CHECK_EQUAL (B->video_length().frames (30), 16); /* Film should have been set to 25fps */ BOOST_CHECK_EQUAL (film->video_frame_rate(), 25); - BOOST_CHECK_EQUAL (A->position(), 0); + BOOST_CHECK_EQUAL (A->position(), DCPTime ()); /* A is 16 frames long at 25 fps */ - BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25); + BOOST_CHECK_EQUAL (B->position(), DCPTime::from_frames (16, 25)); shared_ptr player = film->make_player (); PlayerWrapper wrap (player); - /* Seek and audio don't get on at the moment */ - player->disable_audio (); for (int i = 0; i < 32; ++i) { optional