commit:     f73fd61fbb0f038db2001075215048846c3474f6
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 26 22:23:32 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Nov 26 22:42:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f73fd61f

media-video/vlc: Fix build with >=media-video/ffmpeg-8

Closes: https://bugs.gentoo.org/961436
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../vlc/files/vlc-3.0.22_rc2-ffmpeg8-1.patch       | 33 +++++++++
 .../vlc/files/vlc-3.0.22_rc2-ffmpeg8-2.patch       | 85 ++++++++++++++++++++++
 media-video/vlc/vlc-3.0.22_rc2.ebuild              |  3 +
 media-video/vlc/vlc-3.0.9999.ebuild                |  3 +
 4 files changed, 124 insertions(+)

diff --git a/media-video/vlc/files/vlc-3.0.22_rc2-ffmpeg8-1.patch 
b/media-video/vlc/files/vlc-3.0.22_rc2-ffmpeg8-1.patch
new file mode 100644
index 000000000000..2ed208dec208
--- /dev/null
+++ b/media-video/vlc/files/vlc-3.0.22_rc2-ffmpeg8-1.patch
@@ -0,0 +1,33 @@
+From c241796a2da4fb5865f1922700f4121f7c4bd444 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <[email protected]>
+Date: Tue, 14 Jan 2025 11:28:21 +0100
+Subject: [PATCH 1/2] avcodec/video: use frame flags instead of fields
+
+The structure fields are deprecated.
+It was introduced in lavu 58.7.100.
+
+(cherry picked from commit c79659bc9cfa2ff14754920a706f89d07d6425e6)
+---
+ modules/codec/avcodec/video.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
+index 8524f575bd..dfd359cfcd 100644
+--- a/modules/codec/avcodec/video.c
++++ b/modules/codec/avcodec/video.c
+@@ -1431,8 +1431,13 @@ static picture_t *DecodeBlock( decoder_t *p_dec, 
block_t **pp_block, bool *error
+         /* Hack to force display of still pictures */
+         p_pic->b_force = p_sys->b_first_frame;
+         p_pic->i_nb_fields = 2 + frame->repeat_pict;
++#if LIBAVUTIL_VERSION_CHECK( 58, 7, 100 )
++        p_pic->b_progressive = !(frame->flags & AV_FRAME_FLAG_INTERLACED);
++        p_pic->b_top_field_first = !!(frame->flags & 
AV_FRAME_FLAG_TOP_FIELD_FIRST);
++#else
+         p_pic->b_progressive = !frame->interlaced_frame;
+         p_pic->b_top_field_first = frame->top_field_first;
++#endif
+ 
+         if (DecodeSidedata(p_dec, frame, p_pic))
+             i_pts = VLC_TICK_INVALID;
+-- 
+2.52.0

diff --git a/media-video/vlc/files/vlc-3.0.22_rc2-ffmpeg8-2.patch 
b/media-video/vlc/files/vlc-3.0.22_rc2-ffmpeg8-2.patch
new file mode 100644
index 000000000000..baeae62acad0
--- /dev/null
+++ b/media-video/vlc/files/vlc-3.0.22_rc2-ffmpeg8-2.patch
@@ -0,0 +1,85 @@
+Source, rebased on top of 3.0.22-rc2:
+https://src.fedoraproject.org/rpms/vlc/c/0eecef99dd1f2ccf9c7059b3f1ca92f04d78c40e?branch=rawhide
+
+From eae5e3786af3157a5c0b78bbb7cee929e670e375 Mon Sep 17 00:00:00 2001
+From: Dominik 'Rathann' Mierzejewski <[email protected]>
+Date: Thu, 6 Nov 2025 11:12:17 +0000
+Subject: [PATCH 2/2] Fix build with FFmpeg 8
+
+Backport upstream patches to avoid using deprecated fields and
+definitions.
+
+Signed-off-by: Andreas Sturmlechner <[email protected]>
+---
+ modules/codec/avcodec/avcommon_compat.h | 47 ++++++++++++++++++++++++-
+ 1 file changed, 46 insertions(+), 1 deletion(-)
+
+diff --git a/modules/codec/avcodec/avcommon_compat.h 
b/modules/codec/avcodec/avcommon_compat.h
+index 8ab6910f32..b476c54004 100644
+--- a/modules/codec/avcodec/avcommon_compat.h
++++ b/modules/codec/avcodec/avcommon_compat.h
+@@ -75,9 +75,12 @@
+ #ifndef AV_CODEC_CAP_SMALL_LAST_FRAME
+ # define AV_CODEC_CAP_SMALL_LAST_FRAME CODEC_CAP_SMALL_LAST_FRAME
+ #endif
+-#ifndef AV_INPUT_BUFFER_MIN_SIZE
++#if !defined(AV_INPUT_BUFFER_MIN_SIZE) && defined(FF_MIN_BUFFER_SIZE)
+ # define AV_INPUT_BUFFER_MIN_SIZE FF_MIN_BUFFER_SIZE
+ #endif
++#ifndef AV_INPUT_BUFFER_MIN_SIZE
++# define AV_INPUT_BUFFER_MIN_SIZE 16384
++#endif
+ #ifndef  FF_MAX_B_FRAMES
+ # define  FF_MAX_B_FRAMES 16 // FIXME: remove this
+ #endif
+@@ -87,6 +90,48 @@
+ #ifndef FF_API_STRUCT_VAAPI_CONTEXT
+ # define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
+ #endif
++#ifndef FF_PROFILE_UNKNOWN // removed in ffmpeg 8
++# define FF_PROFILE_UNKNOWN AV_PROFILE_UNKNOWN
++#endif
++#ifndef FF_LEVEL_UNKNOWN
++# define FF_LEVEL_UNKNOWN AV_LEVEL_UNKNOWN
++#endif
++#ifndef FF_PROFILE_HEVC_MAIN
++# define FF_PROFILE_HEVC_MAIN AV_PROFILE_HEVC_MAIN
++#endif
++#ifndef FF_PROFILE_HEVC_MAIN_10
++# define FF_PROFILE_HEVC_MAIN_10 AV_PROFILE_HEVC_MAIN_10
++#endif
++#ifndef FF_PROFILE_VP9_0
++# define FF_PROFILE_VP9_0 AV_PROFILE_VP9_0
++#endif
++#ifndef FF_PROFILE_VP9_2
++# define FF_PROFILE_VP9_2 AV_PROFILE_VP9_2
++#endif
++#ifndef FF_PROFILE_AAC_LOW
++# define FF_PROFILE_AAC_LOW AV_PROFILE_AAC_LOW
++#endif
++#ifndef FF_PROFILE_AAC_MAIN
++# define FF_PROFILE_AAC_MAIN AV_PROFILE_AAC_MAIN
++#endif
++#ifndef FF_PROFILE_AAC_SSR
++# define FF_PROFILE_AAC_SSR AV_PROFILE_AAC_SSR
++#endif
++#ifndef FF_PROFILE_AAC_LTP
++# define FF_PROFILE_AAC_LTP AV_PROFILE_AAC_LTP
++#endif
++#ifndef FF_PROFILE_AAC_HE_V2
++# define FF_PROFILE_AAC_HE_V2 AV_PROFILE_AAC_HE_V2
++#endif
++#ifndef FF_PROFILE_AAC_HE
++# define FF_PROFILE_AAC_HE AV_PROFILE_AAC_HE
++#endif
++#ifndef FF_PROFILE_AAC_LD
++# define FF_PROFILE_AAC_LD AV_PROFILE_AAC_LD
++#endif
++#ifndef FF_PROFILE_AAC_ELD
++# define FF_PROFILE_AAC_ELD AV_PROFILE_AAC_ELD
++#endif
+ 
+ #endif /* HAVE_LIBAVCODEC_AVCODEC_H */
+ 
+-- 
+2.52.0

diff --git a/media-video/vlc/vlc-3.0.22_rc2.ebuild 
b/media-video/vlc/vlc-3.0.22_rc2.ebuild
index 09de0c8ac5e7..c6ffe5224e9e 100644
--- a/media-video/vlc/vlc-3.0.22_rc2.ebuild
+++ b/media-video/vlc/vlc-3.0.22_rc2.ebuild
@@ -244,6 +244,9 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.0.6-fdk-aac-2.0.0.patch # bug 672290
        "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch
        "${FILESDIR}"/${PN}-3.0.18-drop-minizip-dep.patch
+       # bug 961436
+       "${FILESDIR}"/${P}-ffmpeg8-1.patch # upstream git master backport
+       "${FILESDIR}"/${P}-ffmpeg8-2.patch # downstream
 )
 
 pkg_setup() {

diff --git a/media-video/vlc/vlc-3.0.9999.ebuild 
b/media-video/vlc/vlc-3.0.9999.ebuild
index 09de0c8ac5e7..c6ffe5224e9e 100644
--- a/media-video/vlc/vlc-3.0.9999.ebuild
+++ b/media-video/vlc/vlc-3.0.9999.ebuild
@@ -244,6 +244,9 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.0.6-fdk-aac-2.0.0.patch # bug 672290
        "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch
        "${FILESDIR}"/${PN}-3.0.18-drop-minizip-dep.patch
+       # bug 961436
+       "${FILESDIR}"/${P}-ffmpeg8-1.patch # upstream git master backport
+       "${FILESDIR}"/${P}-ffmpeg8-2.patch # downstream
 )
 
 pkg_setup() {

Reply via email to