Closed
Description
I got some errors while building the example with ffmpeg v7 (default version on ubuntu 24.10)
Needed the following patch to have it compile:
diff --git a/examples/ffmpeg-transcode.cpp b/examples/ffmpeg-transcode.cpp
index 20f390de..7c4ff283 100644
--- a/examples/ffmpeg-transcode.cpp
+++ b/examples/ffmpeg-transcode.cpp
@@ -248,11 +248,13 @@ static int decode_audio(struct audio_buffer *audio_buf, s16 **data, int *size)
/* prepare resampler */
swr = swr_alloc();
-
- av_opt_set_int(swr, "in_channel_count", codec->channels, 0);
+ AVChannelLayout out_chlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
+ av_opt_set_int(swr, "in_channel_count", codec->ch_layout.nb_channels, 0);
av_opt_set_int(swr, "out_channel_count", 1, 0);
- av_opt_set_int(swr, "in_channel_layout", codec->channel_layout, 0);
- av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_MONO, 0);
+ av_opt_set_chlayout(swr, "in_chlayout", &codec->ch_layout, 0);
+ av_opt_set_chlayout(swr, "out_chlayout", &out_chlayout, 0);
av_opt_set_int(swr, "in_sample_rate", codec->sample_rate, 0);
av_opt_set_int(swr, "out_sample_rate", WAVE_SAMPLE_RATE, 0);
av_opt_set_sample_fmt(swr, "in_sample_fmt", codec->sample_fmt, 0);
Metadata
Metadata
Assignees
Labels
No labels