summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_file_encoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-08 08:10:07 +0200
committerCarl Hetherington <cth@carlh.net>2025-10-15 22:33:26 +0200
commit46990a835dd084e8294e74913daaa2c2ab31b2a2 (patch)
tree8ca4f99dad4533b1abfac48685938133541a541f /src/lib/ffmpeg_file_encoder.cc
parent2d8d05c2e7ad67ebac2ff250670a219a891d09ca (diff)
Support FFmpeg 8 (for Arch).
Diffstat (limited to 'src/lib/ffmpeg_file_encoder.cc')
-rw-r--r--src/lib/ffmpeg_file_encoder.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc
index 9f391df5d..1a1f8fed6 100644
--- a/src/lib/ffmpeg_file_encoder.cc
+++ b/src/lib/ffmpeg_file_encoder.cc
@@ -73,7 +73,12 @@ public:
_codec_context->bit_rate = channels * 128 * 1024;
_codec_context->sample_fmt = sample_format;
_codec_context->sample_rate = frame_rate;
- av_channel_layout_default(&_codec_context->ch_layout, channels);
+ if (codec_name == "aac" && channels == 16) {
+ /* The default layout for AAC with 16 channels is not valid */
+ _codec_context->ch_layout = AV_CHANNEL_LAYOUT_HEXADECAGONAL;
+ } else {
+ av_channel_layout_default(&_codec_context->ch_layout, channels);
+ }
int r = avcodec_open2(_codec_context, _codec, 0);
if (r < 0) {