summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-27 15:54:13 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-27 15:54:13 +0100
commit52dc5e2f2d0e5be8e9ba75b5978a1de58b11cb25 (patch)
tree131d4cda682f1ca95ebf7f24004e272f4c4a62d3 /test
parentee1ff372a27202a0244f48a04c955dbb48644573 (diff)
Fix Player::dcp_to_content_video with similar but not equal content/DCP frame rates.
Diffstat (limited to 'test')
-rw-r--r--test/time_calculation_test.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc
index 9f91be584..f11f0dc28 100644
--- a/test/time_calculation_test.cc
+++ b/test/time_calculation_test.cc
@@ -330,6 +330,21 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.00)), 72);
BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (4.50)), 144);
BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (9.75)), 396);
+
+ /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
+ content->set_position (DCPTime::from_seconds (0));
+ content->set_trim_start (ContentTime::from_seconds (0));
+ content->set_video_frame_rate (29.9978733);
+ film->set_video_frame_rate (30);
+ player->setup_pieces ();
+ BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
+ piece = player->_pieces.front ();
+ BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
+ BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime (3200)), 1);
+ BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime (6400)), 2);
+ BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime (9600)), 3);
+ BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime (12800)), 4);
+
}
/** Test Player::content_video_to_dcp */