From e693f644aebf53df8979edfcc34fc6cb14ba233b Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Fri, 26 Apr 2024 16:00:13 -0400 Subject: [PATCH] win-dshow: Fix compiling with FFmpeg 7.0 --- plugins/win-dshow/ffmpeg-decode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/win-dshow/ffmpeg-decode.c b/plugins/win-dshow/ffmpeg-decode.c index 541f59fae..e5ba5ea4f 100644 --- a/plugins/win-dshow/ffmpeg-decode.c +++ b/plugins/win-dshow/ffmpeg-decode.c @@ -265,8 +265,13 @@ bool ffmpeg_decode_audio(struct ffmpeg_decode *decode, uint8_t *data, audio->samples_per_sec = decode->frame->sample_rate; audio->format = convert_sample_format(decode->frame->format); +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 24, 100) audio->speakers = convert_speaker_layout((uint8_t)decode->decoder->channels); +#else + audio->speakers = convert_speaker_layout( + (uint8_t)decode->decoder->ch_layout.nb_channels); +#endif audio->frames = decode->frame->nb_samples;