Bump ffmpeg to 5.1.2 "Riemann"
[dcpomatic.git] / src / lib / ffmpeg_file_encoder.cc
index 0d5167c496c109ae0b7f4db56d28ee350d4134e8..1294b9b3cbd1200c66ee6bc97b18b2f936edcdd7 100644 (file)
@@ -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);