public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/wf-recorder] rawhide: fix build with FFmpeg 9
@ 2026-09-03 9:02 Dominik 'Rathann' Mierzejewski
0 siblings, 0 replies; only message in thread
From: Dominik 'Rathann' Mierzejewski @ 2026-09-03 9:02 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/wf-recorder
Branch : rawhide
Commit : 60a10405344baf16477965e91993489d0f5b27db
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date : 2026-08-19T21:25:12+02:00
Stats : +124/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/wf-recorder/c/60a10405344baf16477965e91993489d0f5b27db?branch=rawhide
Log:
fix build with FFmpeg 9
Use patch from ArchLinux.
---
diff --git a/wf-recorder-fix-build-with-ffmpeg9.patch b/wf-recorder-fix-build-with-ffmpeg9.patch
new file mode 100644
index 0000000..f5efbf5
--- /dev/null
+++ b/wf-recorder-fix-build-with-ffmpeg9.patch
@@ -0,0 +1,118 @@
+From c30e95d3b196b24c1c30bcbc468d71ffcc660609 Mon Sep 17 00:00:00 2001
+From: Dominik Mierzejewski <dominik@greysector.net>
+Date: Wed, 19 Aug 2026 21:17:50 +0200
+Subject: [PATCH] fix build failure with FFmpeg 9
+
+Authored-by: Antonio Rojas @ archlinux.org
+
+https://gitlab.archlinux.org/archlinux/packaging/packages/wf-recorder/-/blob/main/ffmpeg-9.patch
+
+---
+ src/frame-writer.cpp | 42 ++++++++++++++++++++++++++----------------
+ 1 file changed, 26 insertions(+), 16 deletions(-)
+
+diff --git a/src/frame-writer.cpp b/src/frame-writer.cpp
+index ad526f8..72e64ac 100644
+--- a/src/frame-writer.cpp
++++ b/src/frame-writer.cpp
+@@ -192,21 +192,23 @@ AVPixelFormat FrameWriter::handle_buffersink_pix_fmt(const AVCodec *codec)
+ auto in_fmt = get_input_format();
+
+ /* For codecs such as rawvideo no supported formats are listed */
+- if (!codec->pix_fmts)
++ const AVPixelFormat* codec_pix_fmts = nullptr;
++ avcodec_get_supported_config(nullptr, codec, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void**)&codec_pix_fmts, nullptr);
++ if (!codec_pix_fmts)
+ return in_fmt;
+
+ /* If the codec supports getting the appropriate RGB format
+ * directly, we want to use it since we don't have to convert data */
+- if (is_fmt_supported(in_fmt, codec->pix_fmts))
++ if (is_fmt_supported(in_fmt, codec_pix_fmts))
+ return in_fmt;
+
+ /* Choose the format supported by the codec which best approximates the
+ * input fmt. */
+ AVPixelFormat best_format = AV_PIX_FMT_NONE;
+- for (int i = 0; codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++) {
++ for (int i = 0; codec_pix_fmts[i] != AV_PIX_FMT_NONE; i++) {
+ int loss = 0;
+ best_format = av_find_best_pix_fmt_of_2(best_format,
+- codec->pix_fmts[i], in_fmt, false, &loss);
++ codec_pix_fmts[i], in_fmt, false, &loss);
+ }
+ return best_format;
+ }
+@@ -518,16 +520,18 @@ void FrameWriter::init_video_stream()
+ static uint64_t get_codec_channel_layout(const AVCodec *codec)
+ {
+ int i = 0;
+- if (!codec->ch_layouts)
++ const AVChannelLayout *codec_ch_layouts = nullptr;
++ avcodec_get_supported_config(nullptr, codec, AV_CODEC_CONFIG_CHANNEL_LAYOUT, 0, (const void**)&codec_ch_layouts, nullptr);
++ if (!codec_ch_layouts)
+ return AV_CH_LAYOUT_STEREO;
+ while (1) {
+- if (!av_channel_layout_check(&codec->ch_layouts[i]))
++ if (!av_channel_layout_check(&codec_ch_layouts[i]))
+ break;
+- if (codec->ch_layouts[i].u.mask == AV_CH_LAYOUT_STEREO)
+- return codec->ch_layouts[i].u.mask;
++ if (codec_ch_layouts[i].u.mask == AV_CH_LAYOUT_STEREO)
++ return codec_ch_layouts[i].u.mask;
+ i++;
+ }
+- return codec->ch_layouts[0].u.mask;
++ return codec_ch_layouts[0].u.mask;
+ }
+ #else
+ static uint64_t get_codec_channel_layout(const AVCodec *codec)
+@@ -549,20 +553,24 @@ static uint64_t get_codec_channel_layout(const AVCodec *codec)
+ static enum AVSampleFormat get_codec_auto_sample_fmt(const AVCodec *codec)
+ {
+ int i = 0;
+- if (!codec->sample_fmts)
++ const AVSampleFormat *codec_sample_fmts = nullptr;
++ avcodec_get_supported_config(nullptr, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, (const void**)&codec_sample_fmts, nullptr);
++ if (!codec_sample_fmts)
+ return av_get_sample_fmt(FALLBACK_AUDIO_SAMPLE_FMT);
+ while (1) {
+- if (codec->sample_fmts[i] == -1)
++ if (codec_sample_fmts[i] == -1)
+ break;
+- if (av_get_bytes_per_sample(codec->sample_fmts[i]) >= 2)
+- return codec->sample_fmts[i];
++ if (av_get_bytes_per_sample(codec_sample_fmts[i]) >= 2)
++ return codec_sample_fmts[i];
+ i++;
+ }
+- return codec->sample_fmts[0];
++ return codec_sample_fmts[0];
+ }
+
+ bool check_fmt_available(const AVCodec *codec, AVSampleFormat fmt){
+- for (const enum AVSampleFormat *sample_ptr = codec -> sample_fmts; *sample_ptr != -1; sample_ptr++)
++ const AVSampleFormat *codec_sample_fmts = nullptr;
++ avcodec_get_supported_config(nullptr, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, (const void**)&codec_sample_fmts, nullptr);
++ for (const enum AVSampleFormat *sample_ptr = codec_sample_fmts; *sample_ptr != -1; sample_ptr++)
+ {
+ if (*sample_ptr == fmt)
+ {
+@@ -575,11 +583,13 @@ bool check_fmt_available(const AVCodec *codec, AVSampleFormat fmt){
+ static enum AVSampleFormat convert_codec_sample_fmt(const AVCodec *codec, std::string requested_fmt)
+ {
+ static enum AVSampleFormat converted_fmt = av_get_sample_fmt(requested_fmt.c_str());
++ const AVSampleFormat *codec_sample_fmts = nullptr;
++ avcodec_get_supported_config(nullptr, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, (const void**)&codec_sample_fmts, nullptr);
+ if (converted_fmt == AV_SAMPLE_FMT_NONE)
+ {
+ std::cerr << "Failed to find the given sample format: " << requested_fmt << std::endl;
+ std::exit(-1);
+- } else if (!codec->sample_fmts || check_fmt_available(codec, converted_fmt))
++ } else if (!codec_sample_fmts || check_fmt_available(codec, converted_fmt))
+ {
+ std::cerr << "Using sample format " << av_get_sample_fmt_name(converted_fmt) << " for audio codec " << codec->name << std::endl;
+ return converted_fmt;
+--
+2.55.0
+
diff --git a/wf-recorder.spec b/wf-recorder.spec
index e891ee1..0ade0fe 100644
--- a/wf-recorder.spec
+++ b/wf-recorder.spec
@@ -11,11 +11,13 @@ Version: 0.6.0
Name: wf-recorder
Summary: Screen recorder for wlroots-based compositors eg swaywm
-Release: 3%{?dist}
+Release: 4%{?dist}
License: MIT
URL: %{forgeurl}
Source0: %{forgesource}
Patch0: wf-recorder-use-free-codecs.patch
+# fix build with FFmpeg 9
+Patch1: wf-recorder-fix-build-with-ffmpeg9.patch
%ifarch ppc64le
# fix compilation on ppc64le (gcc#58241)
@@ -66,6 +68,9 @@ and xdg-output).
%license LICENSE
%changelog
+* Wed Aug 19 2026 Dominik Mierzejewski <dominik@greysector.net> - 0.6.0-4
+- Fixed build with FFmpeg 9
+
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-03 9:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 9:02 [rpms/wf-recorder] rawhide: fix build with FFmpeg 9 Dominik 'Rathann' Mierzejewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox