diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-05-27 02:09:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-05-27 02:09:22 +0100 |
| commit | 387304bc9147933b68eda2b38ba8cac0d250e87e (patch) | |
| tree | 0697a08182c94193a3424d44d5f7af4231f0ade3 /test | |
| parent | fd2b1840496fa121727b7e835843c8beeaebd5eb (diff) | |
Untested use of Frame for video/audio content lengths.
Diffstat (limited to 'test')
| -rw-r--r-- | test/audio_decoder_test.cc | 8 | ||||
| -rw-r--r-- | test/black_fill_test.cc | 4 | ||||
| -rw-r--r-- | test/ffmpeg_decoder_sequential_test.cc | 2 | ||||
| -rw-r--r-- | test/scaling_test.cc | 2 | ||||
| -rw-r--r-- | test/wscript | 1 |
5 files changed, 9 insertions, 8 deletions
diff --git a/test/audio_decoder_test.cc b/test/audio_decoder_test.cc index e31689d3f..7b7fa637b 100644 --- a/test/audio_decoder_test.cc +++ b/test/audio_decoder_test.cc @@ -44,7 +44,7 @@ public: { Frame const N = min ( Frame (2000), - _audio_content->audio_length().frames (_audio_content->resampled_audio_frame_rate ()) - _position + _audio_content->audio_length() - _position ); shared_ptr<AudioBuffers> buffers (new AudioBuffers (_audio_content->audio_channels(), N)); @@ -87,15 +87,15 @@ public: } DCPTime full_length () const { - return DCPTime (audio_length().get ()); + return DCPTime::from_seconds (float (audio_length()) / audio_frame_rate ()); } int audio_channels () const { return 2; } - ContentTime audio_length () const { - return ContentTime::from_seconds (61.2942); + Frame audio_length () const { + return rint (61.2942 * audio_frame_rate ()); } int audio_frame_rate () const { diff --git a/test/black_fill_test.cc b/test/black_fill_test.cc index 5981552d1..e6f4b69ee 100644 --- a/test/black_fill_test.cc +++ b/test/black_fill_test.cc @@ -45,10 +45,10 @@ BOOST_AUTO_TEST_CASE (black_fill_test) wait_for_jobs (); contentA->set_scale (VideoContentScale (Ratio::from_id ("185"))); - contentA->set_video_length (ContentTime::from_frames (3, 24)); + contentA->set_video_length (3); contentA->set_position (DCPTime::from_frames (2, film->video_frame_rate ())); contentB->set_scale (VideoContentScale (Ratio::from_id ("185"))); - contentB->set_video_length (ContentTime::from_frames (1, 24)); + contentB->set_video_length (1); contentB->set_position (DCPTime::from_frames (7, film->video_frame_rate ())); film->make_dcp (); diff --git a/test/ffmpeg_decoder_sequential_test.cc b/test/ffmpeg_decoder_sequential_test.cc index 551157652..6b02efcb5 100644 --- a/test/ffmpeg_decoder_sequential_test.cc +++ b/test/ffmpeg_decoder_sequential_test.cc @@ -54,7 +54,7 @@ test (boost::filesystem::path file, float fps, int gaps) BOOST_CHECK_CLOSE (decoder.video_content()->video_frame_rate(), fps, 0.01); - Frame const N = decoder.video_content()->video_length().frames (decoder.video_content()->video_frame_rate ()); + Frame const N = decoder.video_content()->video_length(); #ifdef DCPOMATIC_DEBUG decoder.test_gaps = 0; #endif diff --git a/test/scaling_test.cc b/test/scaling_test.cc index 441af6bf3..105683ad1 100644 --- a/test/scaling_test.cc +++ b/test/scaling_test.cc @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE (scaling_test) wait_for_jobs (); - imc->set_video_length (ContentTime::from_frames (1, 24)); + imc->set_video_length (1); scaling_test_for (film, imc, "133", "185"); scaling_test_for (film, imc, "185", "185"); diff --git a/test/wscript b/test/wscript index d28b96f41..055dc9def 100644 --- a/test/wscript +++ b/test/wscript @@ -77,6 +77,7 @@ def build(bld): stream_test.cc test.cc threed_test.cc + time_calculation_test.cc update_checker_test.cc upmixer_a_test.cc util_test.cc |
