[packages/hedgewars] - rel 5, build fix for ffmpeg9

baggins baggins at pld-linux.org
Fri Oct 23 22:52:51 CEST 2026


commit 43e09ac5040276c57c013cf782761ba9293de2cf
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Oct 23 22:52:35 2026 +0200

    - rel 5, build fix for ffmpeg9

 ffmpeg9.patch  | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 hedgewars.spec |  4 +++-
 2 files changed, 56 insertions(+), 1 deletion(-)
---
diff --git a/hedgewars.spec b/hedgewars.spec
index af65fa1..9d2eb77 100644
--- a/hedgewars.spec
+++ b/hedgewars.spec
@@ -3,13 +3,14 @@ Summary(hu.UTF-8):	hedgewars - ingyenes Worms-szerű körökre osztott stratégi
 Summary(pl.UTF-8):	hedgewars - strategia czasu rzeczywistego podobna do Worms
 Name:		hedgewars
 Version:	1.0.3
-Release:	4
+Release:	5
 License:	GPL v2 + Public Domain fonts
 Group:		X11/Applications/Games
 Source0:	https://www.hedgewars.org/download/releases/%{name}-src-%{version}.tar.bz2
 # Source0-md5:	9eaad10355c4ad63e42a292efcc7fd4e
 Patch0:		glew.patch
 Patch1:		clang15.patch
+Patch2:		ffmpeg9.patch
 URL:		https://www.hedgewars.org/
 BuildRequires:	Qt5Core-devel
 BuildRequires:	Qt5Gui-devel
@@ -54,6 +55,7 @@ Worms.
 %setup -q -n %{name}-src-%{version}
 %patch -P0 -p1
 %patch -P1 -p1
+%patch -P2 -p1
 
 %build
 mkdir -p build
diff --git a/ffmpeg9.patch b/ffmpeg9.patch
new file mode 100644
index 0000000..cd7f712
--- /dev/null
+++ b/ffmpeg9.patch
@@ -0,0 +1,53 @@
+diff -ru hedgewars-src-1.0.3.orig/hedgewars/avwrapper/avwrapper.c hedgewars-src-1.0.3/hedgewars/avwrapper/avwrapper.c
+--- hedgewars-src-1.0.3.orig/hedgewars/avwrapper/avwrapper.c	2026-08-05 19:17:00.825963815 +0200
++++ hedgewars-src-1.0.3/hedgewars/avwrapper/avwrapper.c	2026-08-05 19:20:40.851138394 +0200
+@@ -233,7 +233,8 @@
+     g_pAudio->sample_fmt = AV_SAMPLE_FMT_S16;
+     g_pAudio->sample_rate = g_Frequency;
+ #if LIBAVCODEC_VERSION_MAJOR >= 60
+-    const AVChannelLayout* pChLayout = g_pACodec->ch_layouts;
++    const AVChannelLayout* pChLayout = NULL;
++    avcodec_get_supported_config(NULL, g_pACodec, AV_CODEC_CONFIG_CHANNEL_LAYOUT, 0, (const void**)&pChLayout, NULL);
+     if (pChLayout)
+     {
+         for (; pChLayout->nb_channels; pChLayout++)
+diff -ru hedgewars-src-1.0.3.orig/QTfrontend/util/LibavInteraction.cpp hedgewars-src-1.0.3/QTfrontend/util/LibavInteraction.cpp
+--- hedgewars-src-1.0.3.orig/QTfrontend/util/LibavInteraction.cpp	2026-08-05 19:17:01.162172382 +0200
++++ hedgewars-src-1.0.3/QTfrontend/util/LibavInteraction.cpp	2026-08-05 19:29:50.665730000 +0200
+@@ -128,14 +128,18 @@
+ 
+         if (pCodec->type == AVMEDIA_TYPE_VIDEO)
+         {
+-            if (pCodec->supported_framerates != NULL)
++            const int *codec_supported_samplerates = NULL;
++            avcodec_get_supported_config(NULL, pCodec, AV_CODEC_CONFIG_SAMPLE_RATE, 0, (const void**)&codec_supported_samplerates, NULL);
++            if (codec_supported_samplerates != NULL)
+                 continue;
+ 
+             // check if codec supports yuv 4:2:0 format
+-            if (!pCodec->pix_fmts)
++            const enum AVPixelFormat* codec_pix_fmts = NULL;
++            avcodec_get_supported_config(NULL, pCodec, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void**)&codec_pix_fmts, NULL);
++            if (!codec_pix_fmts)
+                 continue;
+             bool yuv420Supported = false;
+-            for (const enum AVPixelFormat* pfmt = pCodec->pix_fmts; *pfmt != -1; pfmt++)
++            for (const enum AVPixelFormat* pfmt = codec_pix_fmts; *pfmt != -1; pfmt++)
+                 if (*pfmt == AV_PIX_FMT_YUV420P)
+                 {
+                     yuv420Supported = true;
+@@ -147,10 +151,12 @@
+         if (pCodec->type == AVMEDIA_TYPE_AUDIO)
+         {
+             // check if codec supports signed 16-bit format
+-            if (!pCodec->sample_fmts)
++            const enum AVSampleFormat *codec_sample_fmts = NULL;
++            avcodec_get_supported_config(NULL, pCodec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, (const void**)&codec_sample_fmts, NULL);
++            if (!codec_sample_fmts)
+                 continue;
+             bool s16Supported = false;
+-            for (const enum AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
++            for (const enum AVSampleFormat* pfmt = codec_sample_fmts; *pfmt != -1; pfmt++)
+                 if (*pfmt == AV_SAMPLE_FMT_S16)
+                 {
+                     s16Supported = true;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/hedgewars.git/commitdiff/43e09ac5040276c57c013cf782761ba9293de2cf



More information about the pld-cvs-commit mailing list