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/blender] f45: Backport support for FFmpeg 9
Date: Fri, 18 Sep 2026 17:04:44 GMT [thread overview]
Message-ID: <178975108479.1.11501349789414052948.rpms-blender-88ce2094c792@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/blender
Branch : f45
Commit : 88ce2094c792270cc9fb155e1daf1e281bbfda09
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date : 2026-09-18T17:44:58+02:00
Stats : +140/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/blender/c/88ce2094c792270cc9fb155e1daf1e281bbfda09?branch=f45
Log:
Backport support for FFmpeg 9
---
diff --git a/blender-ffmpeg9.patch b/blender-ffmpeg9.patch
new file mode 100644
index 0000000..bd13e29
--- /dev/null
+++ b/blender-ffmpeg9.patch
@@ -0,0 +1,137 @@
+From e3c92c22817dc0310a460c22f6b1e8e397517e3b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20M=C3=BCller?= <nexyon@gmail.com>
+Date: Wed, 19 Aug 2026 18:22:35 +0200
+Subject: [PATCH] Audaspace: port ffmpeg 9 support from upstream.
+
+---
+ .../audaspace/plugins/ffmpeg/FFMPEGWriter.cpp | 103 ++++++++++++++++++
+ 1 file changed, 103 insertions(+)
+
+diff --git a/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp b/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
+index 10a80bc6f9bd..2204b0549666 100644
+--- a/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
++++ b/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp
+@@ -38,6 +38,10 @@ AUD_NAMESPACE_BEGIN
+ #if LIBAVCODEC_VERSION_MAJOR < 59
+ #define FFMPEG_OLD_CH_LAYOUT
+ #endif
++/* FFmpeg >= 8.0 */
++#if LIBAVCODEC_VERSION_MAJOR >= 62
++#define FFMPEG_SUPPORTED_CONFIG
++#endif
+
+ void FFMPEGWriter::encode()
+ {
+@@ -330,6 +334,104 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta
+ if(m_formatCtx->oformat->flags & AVFMT_GLOBALHEADER)
+ m_codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
++#ifdef FFMPEG_SUPPORTED_CONFIG
++ const AVSampleFormat* supported_sample_fmts = nullptr;
++ int num_sample_fmts = 0;
++ if(avcodec_get_supported_config(m_codecCtx, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0,
++ reinterpret_cast<const void**>(&supported_sample_fmts), &num_sample_fmts) < 0)
++ AUD_THROW(FileException, "File couldn't be written, couldn't retrieve supported sample formats.");
++
++ bool format_supported = false;
++
++ if(supported_sample_fmts)
++ {
++ for(int i = 0; i < num_sample_fmts; i++)
++ {
++ if(av_get_alt_sample_fmt(supported_sample_fmts[i], false) == m_codecCtx->sample_fmt)
++ {
++ m_deinterleave = av_sample_fmt_is_planar(supported_sample_fmts[i]);
++ m_codecCtx->sample_fmt = supported_sample_fmts[i];
++ format_supported = true;
++ }
++ }
++
++ if(!format_supported && num_sample_fmts > 0)
++ {
++ int chosen_index = 0;
++ auto chosen = av_get_alt_sample_fmt(supported_sample_fmts[chosen_index], false);
++ for(int i = 1; i < num_sample_fmts; i++)
++ {
++ auto fmt = av_get_alt_sample_fmt(supported_sample_fmts[i], false);
++ if((fmt > chosen && chosen < m_codecCtx->sample_fmt) || (fmt > m_codecCtx->sample_fmt && fmt < chosen))
++ {
++ chosen = fmt;
++ chosen_index = i;
++ }
++ }
++
++ m_codecCtx->sample_fmt = supported_sample_fmts[chosen_index];
++ m_deinterleave = av_sample_fmt_is_planar(m_codecCtx->sample_fmt);
++ switch(av_get_alt_sample_fmt(m_codecCtx->sample_fmt, false))
++ {
++ case AV_SAMPLE_FMT_U8:
++ specs.format = FORMAT_U8;
++ m_convert = convert_float_u8;
++ break;
++ case AV_SAMPLE_FMT_S16:
++ specs.format = FORMAT_S16;
++ m_convert = convert_float_s16;
++ break;
++ case AV_SAMPLE_FMT_S32:
++ specs.format = FORMAT_S32;
++ m_convert = convert_float_s32;
++ break;
++ case AV_SAMPLE_FMT_FLT:
++ specs.format = FORMAT_FLOAT32;
++ m_convert = convert_copy<sample_t>;
++ break;
++ case AV_SAMPLE_FMT_DBL:
++ specs.format = FORMAT_FLOAT64;
++ m_convert = convert_float_double;
++ break;
++ default:
++ AUD_THROW(FileException, "File couldn't be written, sample format not supported with ffmpeg.");
++ }
++ }
++ }
++ else
++ {
++ m_codecCtx->sample_fmt = av_get_alt_sample_fmt(m_codecCtx->sample_fmt, false);
++ m_deinterleave = av_sample_fmt_is_planar(m_codecCtx->sample_fmt);
++ }
++
++ const int* supported_samplerates = nullptr;
++ int num_samplerates = 0;
++ if(avcodec_get_supported_config(m_codecCtx, codec, AV_CODEC_CONFIG_SAMPLE_RATE, 0,
++ reinterpret_cast<const void**>(&supported_samplerates), &num_samplerates) < 0)
++ AUD_THROW(FileException, "File couldn't be written, couldn't retrieve supported sample rates.");
++
++ m_codecCtx->sample_rate = 0;
++
++ if(supported_samplerates)
++ {
++ for(int i = 0; i < num_samplerates; i++)
++ {
++ if(supported_samplerates[i] == m_specs.rate)
++ {
++ m_codecCtx->sample_rate = supported_samplerates[i];
++ break;
++ }
++ else if((supported_samplerates[i] > m_codecCtx->sample_rate && m_specs.rate > m_codecCtx->sample_rate) ||
++ (supported_samplerates[i] < m_codecCtx->sample_rate && m_specs.rate < supported_samplerates[i]))
++ {
++ m_codecCtx->sample_rate = supported_samplerates[i];
++ }
++ }
++ }
++
++ if(m_codecCtx->sample_rate == 0)
++ m_codecCtx->sample_rate = m_specs.rate;
++#else
+ bool format_supported = false;
+
+ for(int i = 0; codec->sample_fmts[i] != -1; i++)
+@@ -406,6 +508,7 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta
+
+ if(m_codecCtx->sample_rate == 0)
+ m_codecCtx->sample_rate = m_specs.rate;
++#endif
+
+ m_specs.rate = m_codecCtx->sample_rate;
+
diff --git a/blender.spec b/blender.spec
index 3c947fb..5fd6c46 100644
--- a/blender.spec
+++ b/blender.spec
@@ -71,6 +71,9 @@ Source0: https://download.%{name}.org/source/%{name}-%{version}.tar.xz
# Custom RPM macros
Source1: %{name}-macros-source
+# Backport support for FFmpeg 9
+Patch0: https://github.com/blender/blender/commit/e3c92c22817dc0310a460c22f6b1e8e397517e3b.patch#/blender-ffmpeg9.patch
+
# Build requirements
BuildRequires: boost-devel
BuildRequires: ccache
next reply other threads:[~2026-09-18 17:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 17:04 Dominik 'Rathann' Mierzejewski [this message]
2026-09-20 2:19 [rpms/blender] f45: Backport support for FFmpeg 9 Dominik 'Rathann' Mierzejewski
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=178975108479.1.11501349789414052948.rpms-blender-88ce2094c792@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