summaryrefslogtreecommitdiff
path: root/test/torture_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-03-01 09:42:43 +0100
committerCarl Hetherington <cth@carlh.net>2020-03-01 09:42:43 +0100
commit7534e2cd4b44d29f932834ba14f28f0b4c6b6d60 (patch)
tree3315ea02fce559444ecae0764dedbfcdbc4e1c8d /test/torture_test.cc
parentb24104d631b8c6f44d95f28e2ff3bc608cb221a7 (diff)
Fix broken test.
Diffstat (limited to 'test/torture_test.cc')
-rw-r--r--test/torture_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/torture_test.cc b/test/torture_test.cc
index 8bd541ad2..764491c0a 100644
--- a/test/torture_test.cc
+++ b/test/torture_test.cc
@@ -56,23 +56,23 @@ BOOST_AUTO_TEST_CASE (torture_test1)
film->set_container (Ratio::from_id ("185"));
film->set_sequence (false);
- /* Staircase at an offset of 2000 samples, trimmed both start and end, with a gain of 6dB */
+ /* Staircase at an offset of 2000 samples, trimmed both start and end, with a gain of exactly 2 (linear) */
shared_ptr<Content> staircase = content_factory("test/data/staircase.wav").front ();
film->examine_and_add_content (staircase);
BOOST_REQUIRE (!wait_for_jobs());
staircase->set_position (film, DCPTime::from_frames (2000, film->audio_frame_rate()));
staircase->set_trim_start (ContentTime::from_frames (12, 48000));
staircase->set_trim_end (ContentTime::from_frames (35, 48000));
- staircase->audio->set_gain (linear_to_db(6));
+ staircase->audio->set_gain (20 * log10(2));
- /* And again at an offset of 50000 samples, trimmed both start and end, with a gain of 6dB */
+ /* And again at an offset of 50000 samples, trimmed both start and end, with a gain of exactly 2 (linear) */
staircase = content_factory("test/data/staircase.wav").front ();
film->examine_and_add_content (staircase);
BOOST_REQUIRE (!wait_for_jobs());
staircase->set_position (film, DCPTime::from_frames(50000, film->audio_frame_rate()));
staircase->set_trim_start (ContentTime::from_frames (12, 48000));
staircase->set_trim_end (ContentTime::from_frames (35, 48000));
- staircase->audio->set_gain (linear_to_db(6));
+ staircase->audio->set_gain (20 * log10(2));
/* 1s of red at 5s in */
shared_ptr<Content> red = content_factory("test/data/flat_red.png").front ();