[vlc-commits] [Git][videolan/vlc][master] 8 commits: avcodec: fix compilation with FFmpeg 9

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Aug 8 06:52:27 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
e0aca204 by Steve Lhomme at 2026-08-08T06:01:43+00:00
avcodec: fix compilation with FFmpeg 9

AV_CODEC_ID_V308 / AV_CODEC_ID_V408 / AV_CODEC_ID_V410 are gone [^1].

[^1]: https://code.ffmpeg.org/FFmpeg/FFmpeg/commit/0438966d84deb34394df1929a53ab79fee5cc8d4

- - - - -
cb500e41 by Steve Lhomme at 2026-08-08T06:01:43+00:00
contrib: ffmpeg: pass BUILDCFLAGS/BUILDCPPFLAGS for host compilation

It case it uses CFLAGS and CPPFLAGS

- - - - -
422cca0c by Steve Lhomme at 2026-08-08T06:01:43+00:00
contrib: ffmpeg: update to 9.0

- Extend AMF Color Converter (vf_vpp_amf) HDR capabilities
- LCEVC track muxing support in MP4 muxer
- Playdate video encoder and muxer
- Add v360_vulkan filter
- HE-AAC 960 decoding (DAB+)
- transpose_cuda filter
- Add AMF Frame Rate Converter (vf_frc_amf) filter
- SMPTE 2094-50 metadata support and passthrough
- ProRes RAW VideoToolbox hwaccel
- APV Vulkan hwaccel
- Animated WebP decoder
- Animated WebP demuxer
- Remove CELT decoding support (doesn't affect Opus CELT)
- Remove ogg/celt parsing
- Bitstream filter to split Dolby Vision multi-layer HEVC
- Add AMF hardware memory mapping support.
- ONNX Runtime DNN backend with GPU execution provider support
- Remove deprecated NVENC options and support for pre-11.1 SDK versions

See https://code.ffmpeg.org/FFmpeg/FFmpeg/src/branch/release/9.0/Changelog
and https://jbkempf.com/blog/2026/ffmpeg-9.0/

- - - - -
c9432762 by Steve Lhomme at 2026-08-08T06:01:43+00:00
contrib: ffmpeg: disable unused parts

So it's more visible what needs to be updated.

- - - - -
40980c69 by Steve Lhomme at 2026-08-08T06:01:43+00:00
avcodec: replace FF_INPUT_BUFFER_PADDING_SIZE with AV_INPUT_BUFFER_PADDING_SIZE

It was replaced that way in 29d147c  which is part of ffmpeg 2.8 [^1].

[^1]: https://code.ffmpeg.org/FFmpeg/FFmpeg/commit/29d147c

- - - - -
3531dcbb by Steve Lhomme at 2026-08-08T06:01:43+00:00
avcommon: remove unused flags

- - - - -
66a0ff65 by Steve Lhomme at 2026-08-08T06:01:43+00:00
avcommon: remove AV_xxx flags backward compatibility

They were added in 7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615 which is part of ffmpeg 2.8 [^1].

[^1]: https://code.ffmpeg.org/FFmpeg/FFmpeg/commit/7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615

- - - - -
6bd4ae40 by Steve Lhomme at 2026-08-08T06:01:43+00:00
avcommon: remove libav/ffmpeg log string

We don't support libav since 9f7bf69f739112908d60c1ba9160e698b52a8cdd.

- - - - -


12 changed files:

- + contrib/src/ffmpeg/0009-swscale-x86-use-HOSTCPPFLAGS-instead-of-CPPFLAGS-for.patch
- contrib/src/ffmpeg/SHA512SUMS
- contrib/src/ffmpeg/rules.mak
- modules/codec/avcodec/audio.c
- modules/codec/avcodec/avcodec.c
- modules/codec/avcodec/avcommon_compat.h
- modules/codec/avcodec/encoder.c
- modules/codec/avcodec/fourcc.c
- modules/codec/avcodec/subtitle.c
- modules/codec/avcodec/video.c
- modules/demux/avformat/demux.c
- modules/demux/avformat/mux.c


Changes:

=====================================
contrib/src/ffmpeg/0009-swscale-x86-use-HOSTCPPFLAGS-instead-of-CPPFLAGS-for.patch
=====================================
@@ -0,0 +1,25 @@
+From 03abaac3e22c2e766e9b0bdd11e3150e8dd4dc04 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Wed, 5 Aug 2026 11:45:10 +0200
+Subject: [PATCH 9/9] swscale/x86: use HOSTCPPFLAGS instead of CPPFLAGS for
+ native code
+
+Similar to 976e18fdef8bcd0602b6b94bb157a82a3eb9a1a6.
+---
+ libswscale/x86/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libswscale/x86/Makefile b/libswscale/x86/Makefile
+index 0f7a3dbf2d..4467fd877d 100644
+--- a/libswscale/x86/Makefile
++++ b/libswscale/x86/Makefile
+@@ -32,5 +32,5 @@ $(SUBDIR)x86/ops_int.o: $(SUBDIR)x86/uops_macros.gen.asm
+ $(SUBDIR)x86/ops_float.o: $(SUBDIR)x86/uops_macros.gen.asm
+ $(SUBDIR)x86/uops_macros.gen.asm: $(SRC_PATH)/libswscale/x86/uops_macros.asm.h \
+                                   $(SRC_PATH)/libswscale/uops_macros.h
+-	$(HOSTCC) $(HOSTCC_E) $(CPPFLAGS) $<
++	$(HOSTCC) $(HOSTCC_E) $(HOSTCPPFLAGS) $<
+ endif
+-- 
+2.52.0.windows.1
+


=====================================
contrib/src/ffmpeg/SHA512SUMS
=====================================
@@ -1 +1 @@
-b3adc16fe426217bb607da01c4137cee0a9788fc08e077874336db185d2b7287746a7dc94cf0181ea92cd8afcdb06094ee9456e2986112354f84538cb9a5ed0b  ffmpeg-8.1.2.tar.xz
+2e2fea606b290c306bdef13b4c8efb7a4b138ffa16f94f608f85877f5e7ca93980bda8219eeeed8343c463d302c7a2c46b14902ccbbe1e53483f9411b31b9c69  ffmpeg-9.0.tar.xz


=====================================
contrib/src/ffmpeg/rules.mak
=====================================
@@ -1,22 +1,24 @@
 # FFmpeg
 
-FFMPEG_HASH=ec47a3b95f88fc3f820b900038ac439e4eb3fede
-FFMPEG_MAJVERSION := 8.1
-FFMPEG_REVISION := 2
-FFMPEG_VERSION := $(FFMPEG_MAJVERSION).$(FFMPEG_REVISION)
-# FFMPEG_VERSION := $(FFMPEG_MAJVERSION)
-FFMPEG_BRANCH=release/$(FFMPEG_MAJVERSION)
+# FFMPEG_HASH=ec47a3b95f88fc3f820b900038ac439e4eb3fede
+FFMPEG_MAJVERSION := 9.0
+FFMPEG_REVISION := 0
+# FFMPEG_VERSION := $(FFMPEG_MAJVERSION).$(FFMPEG_REVISION)
+FFMPEG_VERSION := $(FFMPEG_MAJVERSION)
+# FFMPEG_BRANCH=release/$(FFMPEG_MAJVERSION)
 FFMPEG_URL := https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.xz
-FFMPEG_GITURL := https://code.ffmpeg.org/FFmpeg/FFmpeg.git
+# FFMPEG_GITURL := https://code.ffmpeg.org/FFmpeg/FFmpeg.git
 FFMPEG_LAVC_MIN := 57.37.100
 
-FFMPEG_BASENAME := $(subst .,_,$(subst \,_,$(subst /,_,$(FFMPEG_HASH))))
+# FFMPEG_BASENAME := $(subst .,_,$(subst \,_,$(subst /,_,$(FFMPEG_HASH))))
 
 # bsf=vp9_superframe is needed to mux VP9 inside webm/mkv
 FFMPEGCONF = --prefix="$(PREFIX)" --enable-static --disable-shared \
 	--extra-ldflags="$(LDFLAGS)" \
 	--cc="$(CC)" \
 	--host-cc="$(BUILDCC)" \
+	--host-cflags="$(BUILDCFLAGS)" \
+	--host-cppflags="$(BUILDCPPFLAGS)" \
 	--pkg-config="$(PKG_CONFIG)" \
 	--disable-doc \
 	--disable-encoder=vorbis \
@@ -220,8 +222,8 @@ endif
 
 FFMPEGCONF += --nm="$(NM)" --ar="$(AR)" --ranlib="$(RANLIB)"
 
-$(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz:
-	$(call download_git,$(FFMPEG_GITURL),$(FFMPEG_BRANCH),$(FFMPEG_HASH))
+# $(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz:
+# 	$(call download_git,$(FFMPEG_GITURL),$(FFMPEG_BRANCH),$(FFMPEG_HASH))
 
 # .sum-ffmpeg: $(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz
 # 	$(call check_githash,$(FFMPEG_HASH))
@@ -242,6 +244,7 @@ ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.xz .sum-ffmpeg
 	$(APPLY) $(SRC)/ffmpeg/0001-fix-mf_utils-compilation-with-mingw64.patch
 	$(APPLY) $(SRC)/ffmpeg/0011-avcodec-videotoolboxenc-disable-calls-on-unsupported.patch
 	$(APPLY) $(SRC)/ffmpeg/avcodec-fix-compilation-visionos.patch
+	$(APPLY) $(SRC)/ffmpeg/0009-swscale-x86-use-HOSTCPPFLAGS-instead-of-CPPFLAGS-for.patch
 	$(MOVE)
 
 .ffmpeg: ffmpeg


=====================================
modules/codec/avcodec/audio.c
=====================================
@@ -120,7 +120,7 @@ static void InitDecoderConfig( decoder_t *p_dec, AVCodecContext *p_context )
         if( i_size > 0 )
         {
             p_context->extradata =
-                av_malloc( i_size + FF_INPUT_BUFFER_PADDING_SIZE );
+                av_malloc( i_size + AV_INPUT_BUFFER_PADDING_SIZE );
             if( p_context->extradata )
             {
                 uint8_t *p_dst = p_context->extradata;
@@ -128,7 +128,7 @@ static void InitDecoderConfig( decoder_t *p_dec, AVCodecContext *p_context )
                 p_context->extradata_size = i_size;
 
                 memcpy( &p_dst[0],            &p_src[i_offset], i_size );
-                memset( &p_dst[i_size], 0, FF_INPUT_BUFFER_PADDING_SIZE );
+                memset( &p_dst[i_size], 0, AV_INPUT_BUFFER_PADDING_SIZE );
             }
         }
     }
@@ -373,11 +373,11 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
         if( (p_block->i_flags & BLOCK_FLAG_PRIVATE_REALLOCATED) == 0 )
         {
-            *pp_block = p_block = block_Realloc( p_block, 0, p_block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE );
+            *pp_block = p_block = block_Realloc( p_block, 0, p_block->i_buffer + AV_INPUT_BUFFER_PADDING_SIZE );
             if( !p_block )
                 goto end;
-            p_block->i_buffer -= FF_INPUT_BUFFER_PADDING_SIZE;
-            memset( &p_block->p_buffer[p_block->i_buffer], 0, FF_INPUT_BUFFER_PADDING_SIZE );
+            p_block->i_buffer -= AV_INPUT_BUFFER_PADDING_SIZE;
+            memset( &p_block->p_buffer[p_block->i_buffer], 0, AV_INPUT_BUFFER_PADDING_SIZE );
 
             p_block->i_flags |= BLOCK_FLAG_PRIVATE_REALLOCATED;
         }


=====================================
modules/codec/avcodec/avcodec.c
=====================================
@@ -251,7 +251,7 @@ AVCodecContext *ffmpeg_AllocContext( decoder_t *p_dec,
          i_codec_id == AV_CODEC_ID_RAWVIDEO )
          return NULL;
 
-    msg_Dbg( p_dec, "using %s %s", AVPROVIDER(LIBAVCODEC), LIBAVCODEC_IDENT );
+    msg_Dbg( p_dec, "using %s", LIBAVCODEC_IDENT );
 
     /* Initialization must be done before avcodec_find_decoder() */
     vlc_init_avcodec(VLC_OBJECT(p_dec));


=====================================
modules/codec/avcodec/avcommon_compat.h
=====================================
@@ -24,8 +24,6 @@
 #ifndef AVCOMMON_COMPAT_H
 #define AVCOMMON_COMPAT_H 1
 
-#define AVPROVIDER(lib) ((lib##_VERSION_MICRO < 100) ? "libav" : "ffmpeg")
-
 #include <libavcodec/avcodec.h>
 
 /* LIBAVCODEC_VERSION_CHECK checks for the right version of FFmpeg
@@ -36,44 +34,14 @@
 #define LIBAVCODEC_VERSION_CHECK( a, b, c ) \
     (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ))
 
-#ifndef AV_CODEC_FLAG_OUTPUT_CORRUPT
-# define AV_CODEC_FLAG_OUTPUT_CORRUPT CODEC_FLAG_OUTPUT_CORRUPT
-#endif
-#ifndef AV_CODEC_FLAG_GRAY
-# define AV_CODEC_FLAG_GRAY CODEC_FLAG_GRAY
-#endif
-#ifndef AV_CODEC_FLAG_DR1
-# define AV_CODEC_FLAG_DR1 CODEC_FLAG_DR1
-#endif
-#ifndef AV_CODEC_FLAG_DELAY
-# define AV_CODEC_FLAG_DELAY CODEC_FLAG_DELAY
-#endif
-#ifndef AV_CODEC_FLAG2_FAST
-# define AV_CODEC_FLAG2_FAST CODEC_FLAG2_FAST
-#endif
-#ifndef FF_INPUT_BUFFER_PADDING_SIZE
-# define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
-#endif
-#ifndef AV_CODEC_FLAG_INTERLACED_DCT
-# define AV_CODEC_FLAG_INTERLACED_DCT CODEC_FLAG_INTERLACED_DCT
-#endif
-#ifndef AV_CODEC_FLAG_INTERLACED_ME
-# define AV_CODEC_FLAG_INTERLACED_ME CODEC_FLAG_INTERLACED_ME
-#endif
-#ifndef AV_CODEC_FLAG_GLOBAL_HEADER
-# define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
-#endif
-#ifndef AV_CODEC_FLAG_LOW_DELAY
-# define AV_CODEC_FLAG_LOW_DELAY CODEC_FLAG_LOW_DELAY
-#endif
-#ifndef AV_CODEC_CAP_SMALL_LAST_FRAME
-# define AV_CODEC_CAP_SMALL_LAST_FRAME CODEC_CAP_SMALL_LAST_FRAME
-#endif
-
 #ifndef FF_API_AVIO_WRITE_NONCONST // removed in ffmpeg 7
 # define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61)
 #endif
 
+#ifndef FF_API_V408_CODECID // removed in ffmpeg 9
+# define FF_API_V408_CODECID (LIBAVCODEC_VERSION_MAJOR < 63)
+#endif
+
 # include <libavutil/avutil.h>
 
 /* LIBAVUTIL_VERSION_CHECK checks for the right version of FFmpeg


=====================================
modules/codec/avcodec/encoder.c
=====================================
@@ -331,7 +331,7 @@ int InitVideoEnc( vlc_object_t *p_this )
 
     const struct vlc_encoder_operations *encoder_ops;
 
-    msg_Dbg( p_this, "using %s %s", AVPROVIDER(LIBAVCODEC), LIBAVCODEC_IDENT );
+    msg_Dbg( p_this, "using %s", LIBAVCODEC_IDENT );
 
     /* Initialization must be done before avcodec_find_encoder() */
     vlc_init_avcodec(p_this);


=====================================
modules/codec/avcodec/fourcc.c
=====================================
@@ -237,7 +237,9 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
     { VLC_CODEC_BMVVIDEO, AV_CODEC_ID_BMV_VIDEO },
     { VLC_CODEC_VBLE, AV_CODEC_ID_VBLE },
     { VLC_CODEC_DXTORY, AV_CODEC_ID_DXTORY },
+#if FF_API_V408_CODECID
     { VLC_CODEC_V410, AV_CODEC_ID_V410 },
+#endif
     /* AV_CODEC_ID_XWD */
     { VLC_CODEC_CDXL, AV_CODEC_ID_CDXL },
     /* AV_CODEC_ID_XBM */
@@ -293,8 +295,10 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
     /* ffmpeg only: AV_CODEC_ID_AVUI */
     /* ffmpeg only: AV_CODEC_ID_TARGA_Y216 */
 
+#if FF_API_V408_CODECID
     { VLC_CODEC_V308, AV_CODEC_ID_V308 },
     { VLC_CODEC_V408, AV_CODEC_ID_V408 },
+#endif
     { VLC_CODEC_YUV4, AV_CODEC_ID_YUV4 },
 
     /* ffmpeg only: AV_CODEC_ID_SANM */


=====================================
modules/codec/avcodec/subtitle.c
=====================================
@@ -203,11 +203,11 @@ static subpicture_t *DecodeBlock(decoder_t *dec, block_t **block_ptr)
     *block_ptr =
     block      = block_Realloc(block,
                                0,
-                               block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE);
+                               block->i_buffer + AV_INPUT_BUFFER_PADDING_SIZE);
     if (!block)
         return NULL;
-    block->i_buffer -= FF_INPUT_BUFFER_PADDING_SIZE;
-    memset(&block->p_buffer[block->i_buffer], 0, FF_INPUT_BUFFER_PADDING_SIZE);
+    block->i_buffer -= AV_INPUT_BUFFER_PADDING_SIZE;
+    memset(&block->p_buffer[block->i_buffer], 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
     if( sys->p_codec->id == AV_CODEC_ID_DVB_SUBTITLE && block->i_buffer > 3 )
     {


=====================================
modules/codec/avcodec/video.c
=====================================
@@ -1431,13 +1431,13 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     if( p_block && p_block->i_buffer > 0 )
     {
         p_block = block_Realloc( p_block, 0,
-                            p_block->i_buffer + FF_INPUT_BUFFER_PADDING_SIZE );
+                            p_block->i_buffer + AV_INPUT_BUFFER_PADDING_SIZE );
         if( !p_block )
             return VLCDEC_ECRITICAL;
-        p_block->i_buffer -= FF_INPUT_BUFFER_PADDING_SIZE;
+        p_block->i_buffer -= AV_INPUT_BUFFER_PADDING_SIZE;
         *pp_block = p_block;
         memset( p_block->p_buffer + p_block->i_buffer, 0,
-                FF_INPUT_BUFFER_PADDING_SIZE );
+                AV_INPUT_BUFFER_PADDING_SIZE );
     }
 
     bool b_drain = ( pp_block == NULL );
@@ -1810,7 +1810,7 @@ static void ffmpeg_InitCodec( decoder_t *p_dec )
         p_sys->p_context->extradata_size = i_size + 12;
         p = p_sys->p_context->extradata =
             av_malloc( p_sys->p_context->extradata_size +
-                       FF_INPUT_BUFFER_PADDING_SIZE );
+                       AV_INPUT_BUFFER_PADDING_SIZE );
         if( !p )
             return;
 
@@ -1847,13 +1847,13 @@ static void ffmpeg_InitCodec( decoder_t *p_dec )
     {
         p_sys->p_context->extradata_size = i_size;
         p_sys->p_context->extradata =
-            av_malloc( i_size + FF_INPUT_BUFFER_PADDING_SIZE );
+            av_malloc( i_size + AV_INPUT_BUFFER_PADDING_SIZE );
         if( p_sys->p_context->extradata )
         {
             memcpy( p_sys->p_context->extradata,
                     p_dec->fmt_in->p_extra, i_size );
             memset( p_sys->p_context->extradata + i_size,
-                    0, FF_INPUT_BUFFER_PADDING_SIZE );
+                    0, AV_INPUT_BUFFER_PADDING_SIZE );
         }
     }
 }


=====================================
modules/demux/avformat/demux.c
=====================================
@@ -739,7 +739,7 @@ int avformat_OpenDemux( vlc_object_t *p_this )
     if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
         i_start_time = FROM_AV_TS_NZ(p_sys->ic->start_time);
 
-    msg_Dbg( p_demux, "AVFormat(%s %s) supported stream", AVPROVIDER(LIBAVFORMAT), LIBAVFORMAT_IDENT );
+    msg_Dbg( p_demux, "AVFormat(%s) supported stream", LIBAVFORMAT_IDENT );
     msg_Dbg( p_demux, "    - format = %s (%s)",
              p_sys->fmt->name, p_sys->fmt->long_name );
     msg_Dbg( p_demux, "    - start time = %"PRId64, i_start_time );


=====================================
modules/demux/avformat/mux.c
=====================================
@@ -98,7 +98,7 @@ int avformat_OpenMux( vlc_object_t *p_this )
     bool dummy = !strcmp( p_mux->p_access->psz_access, "dummy");
 
 
-    msg_Dbg( p_mux, "using %s %s", AVPROVIDER(LIBAVFORMAT), LIBAVFORMAT_IDENT );
+    msg_Dbg( p_mux, "using %s", LIBAVFORMAT_IDENT );
 
     vlc_init_avformat(p_this);
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/72f47ae2083b70b7e05dc08e797d51655b8169c1...6bd4ae40536a7a9d41f0b6f7a719ee8c320f692a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/72f47ae2083b70b7e05dc08e797d51655b8169c1...6bd4ae40536a7a9d41f0b6f7a719ee8c320f692a
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list