From 1ef7b9e3e06ef69e5145c6f11cc330078abaa9ea Mon Sep 17 00:00:00 2001
From: Armin Novak <anovak@thincast.com>
Date: Fri, 24 Nov 2023 19:40:52 +0100
Subject: [PATCH] [codec,dsp] fix ffmpeg deprecation warning

---
 libfreerdp/codec/dsp_ffmpeg.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c
index c5c30fb89ed2..c929b3c553a2 100644
--- a/libfreerdp/codec/dsp_ffmpeg.c
+++ b/libfreerdp/codec/dsp_ffmpeg.c
@@ -439,7 +439,13 @@ static BOOL ffmpeg_encode_frame(AVCodecContext* context, AVFrame* in, AVPacket*
 	if (in->format == AV_SAMPLE_FMT_FLTP)
 	{
 		uint8_t** pp = in->extended_data;
-		for (int y = 0; y < in->channels; y++)
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 28, 100)
+		const int nr_channels = in->channels;
+#else
+		const int nr_channels = in->ch_layout.nb_channels;
+#endif
+
+		for (int y = 0; y < nr_channels; y++)
 		{
 			float* data = pp[y];
 			for (int x = 0; x < in->nb_samples; x++)
