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/threed_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/threed_test.cc')
| -rw-r--r-- | test/threed_test.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/threed_test.cc b/test/threed_test.cc index b4599cf80..4413ff01b 100644 --- a/test/threed_test.cc +++ b/test/threed_test.cc @@ -272,7 +272,9 @@ BOOST_AUTO_TEST_CASE (threed_test_butler_overfill) auto player = std::make_shared<Player>(film, Image::Alignment::COMPACT); int const audio_channels = 2; - auto butler = std::make_shared<Butler>(film, player, AudioMapping(), audio_channels, boost::bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false); + auto butler = std::make_shared<Butler>( + film, player, AudioMapping(), audio_channels, boost::bind(PlayerVideo::force, AV_PIX_FMT_RGB24), VideoRange::FULL, Image::Alignment::PADDED, true, false, Butler::Audio::ENABLED + ); int const audio_frames = 1920; std::vector<float> audio(audio_frames * audio_channels); |
