public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
To: git-commits@fedoraproject.org
Subject: [rpms/hedgewars] rawhide: Fixed build with FFmpeg 9
Date: Tue, 18 Aug 2026 20:39:49 GMT	[thread overview]
Message-ID: <178708558959.1.15509175109341543113.rpms-hedgewars-a3d3c4c78037@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/hedgewars
Branch : rawhide
Commit : a3d3c4c78037ea6a423f0c7038936502f04fae45
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date   : 2026-08-18T22:02:46+02:00
Stats  : +60/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/hedgewars/c/a3d3c4c78037ea6a423f0c7038936502f04fae45?branch=rawhide

Log:
Fixed build with FFmpeg 9

---
diff --git a/ffmpeg-9.patch b/ffmpeg-9.patch
new file mode 100644
index 0000000..cd7f712
--- /dev/null
+++ b/ffmpeg-9.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;

diff --git a/hedgewars.spec b/hedgewars.spec
index b7279f4..5b31a3e 100644
--- a/hedgewars.spec
+++ b/hedgewars.spec
@@ -2,7 +2,7 @@
 
 Name:           hedgewars
 Version:        1.0.3
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        Funny turn-based artillery game, featuring fighting Hedgehogs!
 License:        GPL-1.0-or-later
 URL:            http://www.hedgewars.org/
@@ -33,6 +33,9 @@ Patch3:        0a8921bf167481045830095c731eb3c67af913e4.patch
 Patch4:        https://patch-diff.githubusercontent.com/raw/hedgewars/hw/pull/75.patch
 Patch5:        hedgewars-mtl-2.3.patch
 
+# Fix build with FFmpeg 9
+Patch6:         https://gitlab.archlinux.org/archlinux/packaging/packages/hedgewars/-/raw/main/ffmpeg-9.patch
+
 BuildRequires:  cmake gcc-c++ fpc desktop-file-utils
 BuildRequires:  libatomic
 BuildRequires:  qt5-qtbase-devel
@@ -221,6 +224,9 @@ install -pm 0644 %{SOURCE102} %{buildroot}%{_prefix}/lib/firewalld/services/
 %{_datadir}/%{name}/Data/Fonts/wqy-zenhei.ttc
 
 %changelog
+* Tue Aug 18 2026 Dominik Mierzejewski <dominik@greysector.net> - 1.0.3-7
+- Fixed build with FFmpeg 9
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

                 reply	other threads:[~2026-08-18 20:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178708558959.1.15509175109341543113.rpms-hedgewars-a3d3c4c78037@fedoraproject.org \
    --to=dominik@greysector.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox