diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-05-26 20:04:33 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-05-26 20:04:33 +0200 |
| commit | 8987f133295e352c44e05ef338eacc801c61a629 (patch) | |
| tree | 6325c00b2c1097bb483568ddad8b545e0e40f717 /test/butler_test.cc | |
| parent | b6fb82e5df5551497b823f20a75c7ff94ffd1b3e (diff) | |
Fix race between the Butler thread starting and audio (perhaps) being disabled.
This could cause Butler::audio to be called with _audio_channels = 0
and _disable_audio = false, causing an exception in AudioBuffers when
remap() tried to make an AudioBuffers object with a channel count of 0.
Diffstat (limited to 'test/butler_test.cc')
| -rw-r--r-- | test/butler_test.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/butler_test.cc b/test/butler_test.cc index 0422b89ad..7fd5ea571 100644 --- a/test/butler_test.cc +++ b/test/butler_test.cc @@ -60,7 +60,18 @@ BOOST_AUTO_TEST_CASE (butler_test1) map.set (i, i, 1); } - Butler butler (film, make_shared<Player>(film, Image::Alignment::COMPACT), map, 6, boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, false, false); + Butler butler ( + film, + make_shared<Player>(film, Image::Alignment::COMPACT), + map, + 6, + boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), + VideoRange::FULL, + Image::Alignment::COMPACT, + false, + false, + Butler::Audio::ENABLED + ); BOOST_CHECK (butler.get_video(Butler::Behaviour::BLOCKING, 0).second == DCPTime()); BOOST_CHECK (butler.get_video(Butler::Behaviour::BLOCKING, 0).second == DCPTime::from_frames(1, 24)); @@ -95,7 +106,16 @@ BOOST_AUTO_TEST_CASE (butler_test2) } Butler butler ( - film, make_shared<Player>(film, Image::Alignment::COMPACT), map, 6, boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::COMPACT, false, false + film, + make_shared<Player>(film, Image::Alignment::COMPACT), + map, + 6, + boost::bind(&PlayerVideo::force, AV_PIX_FMT_RGB24), + VideoRange::FULL, + Image::Alignment::COMPACT, + false, + false, + Butler::Audio::ENABLED ); int const audio_frames_per_video_frame = 48000 / 25; |
