4 Commits

4 changed files with 121 additions and 3 deletions

73
338.patch Normal file
View File

@@ -0,0 +1,73 @@
From df8402575f1550d79c751051e9006fd3b7fa0fe0 Mon Sep 17 00:00:00 2001
From: Hannes Braun <hannes@hannesbraun.net>
Date: Thu, 9 Oct 2025 20:28:34 +0200
Subject: [PATCH] Fix compatibility with FFmpeg 8
---
src/spek-fft.cc | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/spek-fft.cc b/src/spek-fft.cc
index 3105213f..00d4fa5c 100644
--- a/src/spek-fft.cc
+++ b/src/spek-fft.cc
@@ -2,7 +2,7 @@
#define __STDC_CONSTANT_MACROS
extern "C" {
-#include <libavcodec/avfft.h>
+#include <libavutil/tx.h>
}
#include "spek-fft.h"
@@ -16,7 +16,10 @@ class FFTPlanImpl : public FFTPlan
void execute() override;
private:
- struct RDFTContext *cx;
+ struct AVTXContext *cx;
+ av_tx_fn tx;
+ float* tmp;
+ const int len;
};
std::unique_ptr<FFTPlan> FFT::create(int nbits)
@@ -24,27 +27,31 @@ std::unique_ptr<FFTPlan> FFT::create(int nbits)
return std::unique_ptr<FFTPlan>(new FFTPlanImpl(nbits));
}
-FFTPlanImpl::FFTPlanImpl(int nbits) : FFTPlan(nbits), cx(av_rdft_init(nbits, DFT_R2C))
+FFTPlanImpl::FFTPlanImpl(int nbits) : FFTPlan(nbits), len(1 << nbits)
{
+ const float scale = 1.0;
+ av_tx_init(&this->cx, &this->tx, AV_TX_FLOAT_RDFT, 0, this->len, &scale, 0);
+ this->tmp = (float*) av_malloc((this->len + 2) * sizeof(float));
}
FFTPlanImpl::~FFTPlanImpl()
{
- av_rdft_end(this->cx);
+ av_tx_uninit(&this->cx);
+ av_freep(&this->tmp);
}
void FFTPlanImpl::execute()
{
- av_rdft_calc(this->cx, this->get_input());
+ this->tx(this->cx, this->tmp, this->get_input(), sizeof(AVComplexFloat));
// Calculate magnitudes.
int n = this->get_input_size();
float n2 = n * n;
- this->set_output(0, 10.0f * log10f(this->get_input(0) * this->get_input(0) / n2));
- this->set_output(n / 2, 10.0f * log10f(this->get_input(1) * this->get_input(1) / n2));
+ this->set_output(0, 10.0f * log10f(this->tmp[0] * this->tmp[0] / n2));
for (int i = 1; i < n / 2; i++) {
- float re = this->get_input(i * 2);
- float im = this->get_input(i * 2 + 1);
+ float re = this->tmp[i * 2];
+ float im = this->tmp[i * 2 + 1];
this->set_output(i, 10.0f * log10f((re * re + im * im) / n2));
}
+ this->set_output(n / 2, 10.0f * log10f(this->tmp[this->len] * this->tmp[this->len] / n2));
}

31
spek-autotools.patch Normal file
View File

@@ -0,0 +1,31 @@
From e20ce13a5305327b7dfec9303f1487520095f36d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
Date: Wed, 16 Jul 2025 13:10:44 +0200
Subject: [PATCH] Fix build with recent autotools
Tell autoconf where m4 macros are, or else the build fails like this:
configure.ac:12: the top level
configure.ac:71: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:72: error: possibly undefined macro: AM_GNU_GETTEXT
autoreconf: error: /nix/store/0qmqybsb86p5g6vqxj992grj9hyh72wa-autoconf-2.72/bin/autoconf failed with exit status: 1
This is a backward compatible change.
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index fe95c88..1c4b370 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,7 @@
AC_INIT([spek],[0.8.5])
AC_CONFIG_SRCDIR([src/spek.cc])
AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([1.11.1 foreign no-dist-gzip dist-xz serial-tests])
AM_SILENT_RULES([yes])

View File

@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon Oct 13 18:03:33 UTC 2025 - Martin Hauke <mardnh@gmx.de>
- Add patch:
* https://github.com/alexkay/spek/pull/338.patch
Fix compatibility with FFmpeg8
-------------------------------------------------------------------
Tue Aug 19 07:57:31 UTC 2025 - Edgar Aichinger <edogawa@aon.at>
- add spek-autotools.patch (GH PR #333, fixes x86_64 build)
- remove update-desktop-files
-------------------------------------------------------------------
Wed Oct 9 14:45:58 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package spek
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,6 +24,9 @@ License: GPL-3.0-only
Group: Productivity/Multimedia/Sound/Utilities
URL: https://www.spek.cc/
Source: https://github.com/alexkay/spek/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM spek-autotools.patch -- based on PR 333
Patch0: spek-autotools.patch
Patch1: https://github.com/alexkay/spek/pull/338.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
@@ -31,7 +34,6 @@ BuildRequires: gettext >= 0.21
BuildRequires: hicolor-icon-theme
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: wxGTK-devel
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
@@ -61,7 +63,6 @@ export CXXFLAGS="%{optflags} $(pkg-config --cflags-only-I libavutil)"
%install
%make_install
%suse_update_desktop_file -r %{name} AudioVideo Player
%find_lang %{name}
%files -f %{name}.lang