summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_file_encoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-09-30 22:46:33 +0200
committerCarl Hetherington <cth@carlh.net>2023-10-16 11:35:33 +0200
commita37dbbc42a99baeea21f8937f114fb350001595c (patch)
tree365556cd5e5af217c79878bd5e22ea50b06e0572 /src/lib/ffmpeg_file_encoder.cc
parent2ecf279c41b65ec5d74ac3c441b0fef30cf27081 (diff)
Bump ffmpeg to 5.1.2 "Riemann"
Diffstat (limited to 'src/lib/ffmpeg_file_encoder.cc')
-rw-r--r--src/lib/ffmpeg_file_encoder.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc
index f96a9458e..224c15107 100644
--- a/src/lib/ffmpeg_file_encoder.cc
+++ b/src/lib/ffmpeg_file_encoder.cc
@@ -73,8 +73,7 @@ public:
_codec_context->bit_rate = channels * 128 * 1024;
_codec_context->sample_fmt = sample_format;
_codec_context->sample_rate = frame_rate;
- _codec_context->channel_layout = av_get_default_channel_layout (channels);
- _codec_context->channels = channels;
+ av_channel_layout_default(&_codec_context->ch_layout, channels);
int r = avcodec_open2 (_codec_context, _codec, 0);
if (r < 0) {
@@ -143,7 +142,7 @@ public:
frame->nb_samples = size;
frame->format = _codec_context->sample_fmt;
- frame->channels = channels;
+ frame->ch_layout.nb_channels = channels;
int r = avcodec_fill_audio_frame (frame, channels, _codec_context->sample_fmt, (const uint8_t *) samples, buffer_size, 0);
DCPOMATIC_ASSERT (r >= 0);