codec: avcodec: fix ch_layout requirement
authorFrançois Cartegnie <fcvlcdev@free.fr>
Mon, 10 Jun 2024 04:10:37 +0000 (11:10 +0700)
committerSebastian Ramacher <sramacher@debian.org>
Fri, 7 Mar 2025 06:31:22 +0000 (07:31 +0100)
refs #28667

(cherry picked from commit 41778535dcae8b145ebfaa0392de281e470a91bf) (edited)
edited:
- on 3.0 the audio check was still using a LIBAVCODEC_VERSION_CHECK check
- the mux/demux checks were already there with different spaces

Gbp-Pq: Name 0091-codec-avcodec-fix-ch_layout-requirement.patch

modules/codec/avcodec/audio.c
modules/demux/avformat/demux.c
modules/demux/avformat/mux.c

index 04c540173bf9cba963ae1b92a81509ad137fa12e..979256c400adeb03057c3e2a9a09f3e612b4be08 100644 (file)
@@ -142,7 +142,7 @@ static int OpenAudioCodec( decoder_t *p_dec )
     }
 
     ctx->sample_rate = p_dec->fmt_in.audio.i_rate;
-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
+#if 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;
index 9975b0f47b673c17694c9209664bd98d388572ab..c49f7eb4fc0e879bd075698b7b25f3b7f1a165d5 100644 (file)
@@ -400,7 +400,7 @@ int avformat_OpenDemux( vlc_object_t *p_this )
             es_format_Init( &es_fmt, AUDIO_ES, fcc );
             es_fmt.i_original_fourcc = CodecTagToFourcc( cp->codec_tag );
             es_fmt.i_bitrate = cp->bit_rate;
-#if LIBAVCODEC_VERSION_CHECK( 59, 24, 100 )
+#if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
             es_fmt.audio.i_channels = cp->ch_layout.nb_channels;
 #else
             es_fmt.audio.i_channels = cp->channels;
index a48190c93ca0eb543d23c8844b63301d4d989742..090ed9f5bfa854a56f128d88df778f104d5596f7 100644 (file)
@@ -273,7 +273,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     {
     case AUDIO_ES:
         codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
-#if LIBAVCODEC_VERSION_CHECK( 59, 24, 100 )
+#if LIBAVCODEC_VERSION_CHECK(59, 24, 100)
         av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels );
 #else
         codecpar->channels = fmt->audio.i_channels;