[packages/wf-recorder] - rel 3, build fixes for ffmpeg 9

baggins baggins at pld-linux.org
Thu Oct 22 23:47:10 CEST 2026


commit 39e4d1b7515a350cc01c37b9cb7a3d9e9c319594
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Oct 22 23:46:53 2026 +0200

    - rel 3, build fixes for ffmpeg 9

 ffmpeg9.patch    | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 wf-recorder.spec |   4 +-
 2 files changed, 121 insertions(+), 1 deletion(-)
---
diff --git a/wf-recorder.spec b/wf-recorder.spec
index 053d575..6f77e64 100644
--- a/wf-recorder.spec
+++ b/wf-recorder.spec
@@ -1,11 +1,12 @@
 Summary:	Screen recording of wlroots-based compositors
 Name:		wf-recorder
 Version:	0.6.0
-Release:	2
+Release:	3
 License:	MIT
 Group:		Applications
 Source0:	https://github.com/ammen99/wf-recorder/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	23b7dc5037486ab6d2675d9ef338faf3
+Patch0:		ffmpeg9.patch
 URL:		https://github.com/ammen99/wf-recorder
 BuildRequires:	Mesa-libgbm-devel
 BuildRequires:	ffmpeg-devel
@@ -29,6 +30,7 @@ and xdg-output).
 
 %prep
 %setup -q
+%patch -P0 -p1
 
 %build
 %meson
diff --git a/ffmpeg9.patch b/ffmpeg9.patch
new file mode 100644
index 0000000..f5efbf5
--- /dev/null
+++ b/ffmpeg9.patch
@@ -0,0 +1,118 @@
+From c30e95d3b196b24c1c30bcbc468d71ffcc660609 Mon Sep 17 00:00:00 2001
+From: Dominik Mierzejewski <dominik at 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
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/wf-recorder.git/commitdiff/39e4d1b7515a350cc01c37b9cb7a3d9e9c319594



More information about the pld-cvs-commit mailing list