From 99b13218296a0f8e9c10ff5f3883970fc7daa1c3 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 19 Jun 2024 13:41:04 +0200 Subject: [PATCH] avcodec: fix libavcodec version check for AVCodecContext.ch_layout MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It was added in 548aeb93834b8425c86d1ce60fddc1d41805724d which was libavcodec 59.23.100 at the time but the minor version was not updated in that commit so we check 59.24.100. This is part of FFmpeg 5.1. https://github.com/FFmpeg/FFmpeg/commit/548aeb93834b8425c86d1ce60fddc1d41805724d Co-authored-by: François Cartegnie (cherry picked from commit 8fd918b8787b8d077decf1a2b955ab0c7b964bf3) (rebased) rebased: - on 3.0 fmt_in is not a pointer Gbp-Pq: Name 0094-avcodec-fix-libavcodec-version-check-for-AVCodecCont.patch --- modules/codec/avcodec/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c index 979256c4..fb22f033 100644 --- a/modules/codec/avcodec/audio.c +++ b/modules/codec/avcodec/audio.c @@ -142,7 +142,7 @@ static int OpenAudioCodec( decoder_t *p_dec ) } ctx->sample_rate = p_dec->fmt_in.audio.i_rate; -#if LIBAVUTIL_VERSION_CHECK(57, 24, 100) +#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); #else ctx->channels = p_dec->fmt_in.audio.i_channels; -- 2.30.2