diff --git a/libfreerdp/codec/dsp_ffmpeg.c b/libfreerdp/codec/dsp_ffmpeg.c index c5c30fb89..c929b3c55 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++)