summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_encoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-05-26 20:04:33 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-26 20:04:33 +0200
commit8987f133295e352c44e05ef338eacc801c61a629 (patch)
tree6325c00b2c1097bb483568ddad8b545e0e40f717 /src/lib/ffmpeg_encoder.cc
parentb6fb82e5df5551497b823f20a75c7ff94ffd1b3e (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 'src/lib/ffmpeg_encoder.cc')
-rw-r--r--src/lib/ffmpeg_encoder.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc
index d4f0b4b47..bcf2b82de 100644
--- a/src/lib/ffmpeg_encoder.cc
+++ b/src/lib/ffmpeg_encoder.cc
@@ -108,7 +108,16 @@ FFmpegEncoder::FFmpegEncoder (
}
_butler = std::make_shared<Butler>(
- _film, _player, map, _output_audio_channels, bind(&PlayerVideo::force, FFmpegFileEncoder::pixel_format(format)), VideoRange::VIDEO, Image::Alignment::PADDED, false, false
+ _film,
+ _player,
+ map,
+ _output_audio_channels,
+ bind(&PlayerVideo::force, FFmpegFileEncoder::pixel_format(format)),
+ VideoRange::VIDEO,
+ Image::Alignment::PADDED,
+ false,
+ false,
+ Butler::Audio::ENABLED
);
}