Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package QMPlay2 for openSUSE:Factory checked in at 2026-06-27 18:07:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/QMPlay2 (Old) and /work/SRC/openSUSE:Factory/.QMPlay2.new.11887 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "QMPlay2" Sat Jun 27 18:07:25 2026 rev:99 rq:1361921 version:25.09.11 Changes: -------- --- /work/SRC/openSUSE:Factory/QMPlay2/QMPlay2.changes 2026-06-11 17:29:55.260771522 +0200 +++ /work/SRC/openSUSE:Factory/.QMPlay2.new.11887/QMPlay2.changes 2026-06-27 18:09:41.879282804 +0200 @@ -1,0 +2,6 @@ +Fri Jun 26 12:59:53 UTC 2026 - Dmitriy Perlow <[email protected]> + +- Added 0002-sidplayfp-v3-github-1008-or-f502b11.diff and + USE_CHIPTUNE_SID set to ON back. + +------------------------------------------------------------------- New: ---- 0002-sidplayfp-v3-github-1008-or-f502b11.diff ----------(New B)---------- New: - Added 0002-sidplayfp-v3-github-1008-or-f502b11.diff and USE_CHIPTUNE_SID set to ON back. ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ QMPlay2.spec ++++++ --- /var/tmp/diff_new_pack.C7rnez/_old 2026-06-27 18:09:42.719311251 +0200 +++ /var/tmp/diff_new_pack.C7rnez/_new 2026-06-27 18:09:42.723311386 +0200 @@ -32,6 +32,8 @@ Source: %{name}-%{version}.%{_mtime}.%{_commit}.tar.gz # PATCH-FEATURE-OPENSUSE 0001-add-opensuse-customizations.patch -- Fix python executable detection and add branding Patch1: 0001-add-opensuse-customizations.patch +# PATCH-FIX-UPSTREAM 0002-sidplayfp-v3-github-1008-or-f502b11.diff -- Sidplayfp v3 support. +Patch2: 0002-sidplayfp-v3-github-1008-or-f502b11.diff BuildRequires: clang BuildRequires: cmake >= 3.16 BuildRequires: lld @@ -74,7 +76,7 @@ BuildRequires: pkgconfig(libgme) BuildRequires: pkgconfig(libpipewire-0.3) BuildRequires: pkgconfig(libpulse) -# BuildRequires: pkgconfig(libsidplayfp) +BuildRequires: pkgconfig(libsidplayfp) >= 3 BuildRequires: pkgconfig(libswresample) >= 3.1.100 BuildRequires: pkgconfig(libswscale) >= 5.1.100 BuildRequires: pkgconfig(libva) @@ -145,7 +147,7 @@ %else -DBUILD_WITH_QT6=OFF \ %endif - -DUSE_CHIPTUNE_SID=OFF \ + -DUSE_CHIPTUNE_SID=ON \ -DUSE_PORTAUDIO=ON \ -DUSE_PIPEWIRE=ON \ %if 0%{?suse_version} >= 1699 || 0%{?sle_version} >= 150500 ++++++ 0002-sidplayfp-v3-github-1008-or-f502b11.diff ++++++ diff --git a/src/modules/Chiptune/SIDPlay.cpp b/src/modules/Chiptune/SIDPlay.cpp index 52801e4a1..650ffcf55 100644 --- a/src/modules/Chiptune/SIDPlay.cpp +++ b/src/modules/Chiptune/SIDPlay.cpp @@ -28,11 +28,15 @@ #include <sidplayfp/SidTune.h> #include <sidplayfp/SidInfo.h> +#include <cmath> + +static constexpr unsigned int CYCLES = 10509; // 512 samples @48kHz (PAL 985249 Hz), 10.67ms + SIDPlay::SIDPlay(Module &module) : m_srate(Functions::getBestSampleRate()), m_aborted(false), m_time(-1.0), - m_rs(nullptr), + m_rs("QMPlay2"), m_tune(nullptr) { SetModule(module); @@ -73,17 +77,14 @@ bool SIDPlay::seek(double s, bool backward) { m_time = -1.0; - if (backward && !m_sidplay.load(m_tune)) //backward + if (backward && !m_sidplay.reset()) return false; if (s > 0.0) { - const int pos = s; - const int bufferSize = m_chn * m_srate; - qint16 *buff1sec = new qint16[bufferSize]; - for (int i = m_sidplay.time(); i <= pos && !m_aborted; ++i) - m_sidplay.play(buff1sec, bufferSize); - delete[] buff1sec; + const auto posMs = static_cast<uint_least32_t>(s * 1000.0); + while (m_sidplay.timeMs() <= posMs && !m_aborted) + m_sidplay.play(CYCLES); } return true; @@ -99,24 +100,43 @@ bool SIDPlay::read(Packet &decoded, int &idx) if (m_time > m_length) return false; - const int chunkSize = 1024 * m_chn; +#if LIBSIDPLAYFP_VERSION_MAJ >= 3 + const int bufSize = m_sidplay.getBufSize(CYCLES); +#else + const double cpuSpeed = (m_tune->getInfo()->clockSpeed() == SidTuneInfo::CLOCK_NTSC) + ? 3579545.455 * 4.0 / 14.0 // NTSC + : 4433618.75 * 4.0 / 18.0; // PAL + const int bufSize = static_cast<int>(std::ceil(static_cast<double>(m_srate) / cpuSpeed * CYCLES)) * m_chn; +#endif + if (bufSize <= 0) + return false; + + const int requiredSize = bufSize * sizeof(int16_t); + if (m_mixBuf.size() < requiredSize) + { + m_mixBuf.clear(); + m_mixBuf.resize(requiredSize); + } + int16_t *mixData = (int16_t *)m_mixBuf.data(); + + const int res = m_sidplay.play(CYCLES); + if (res <= 0) + return false; - decoded.resize(chunkSize * sizeof(float)); + const int sampleCount = m_sidplay.mix(mixData, res); - int16_t *srcData = (int16_t *)decoded.data(); + decoded.resize(sampleCount * sizeof(float)); float *dstData = (float *)decoded.data(); - m_sidplay.play(srcData, chunkSize); - - for (int i = chunkSize - 1; i >= 0; --i) - dstData[i] = srcData[i] / 16384.0; + for (int i = sampleCount - 1; i >= 0; --i) + dstData[i] = mixData[i] / 32768.0; const double fadePos = m_time - (m_length - 5); if (fadePos >= 0) - ChiptuneCommon::doFadeOut(dstData, chunkSize, m_chn, m_srate, fadePos, 5.0); + ChiptuneCommon::doFadeOut(dstData, sampleCount, m_chn, m_srate, fadePos, 5.0); decoded.setTS(m_time); - decoded.setDuration(chunkSize / m_chn / (double)m_srate); + decoded.setDuration(sampleCount / m_chn / (double)m_srate); idx = 0; @@ -147,7 +167,7 @@ Playlist::Entries SIDPlay::fetchTracks(const QString &url, bool &ok) if (info) { Playlist::Entry entry; - entry.url = SIDPlayName + QString("://{%1}%2").arg(m_url).arg(i); + entry.url = SIDPlayName + QStringLiteral("://{%1}%2").arg(m_url).arg(i); entry.name = getTitle(info, i); entry.length = m_length; entries.append(entry); @@ -215,23 +235,19 @@ bool SIDPlay::open(const QString &_url, bool tracksOnly) if (track >= (int)info->songs()) return false; - m_rs.create(m_sidplay.info().maxsids()); - if (!m_rs.getStatus()) - return false; - m_rs.filter(true); - -#if ((LIBSIDPLAYFP_VERSION_MAJ << 16 | LIBSIDPLAYFP_VERSION_MIN << 8 | LIBSIDPLAYFP_VERSION_LEV) > 0x010800) - const bool isStereo = info->sidChips() > 1 ? true : false; -#else - const bool isStereo = info->isStereo(); -#endif + const bool isStereo = info->sidChips() > 1; SidConfig cfg; cfg.frequency = m_srate; cfg.sidEmulation = &m_rs; - if (isStereo) - cfg.playback = SidConfig::STEREO; cfg.samplingMethod = SidConfig::INTERPOLATE; +#if LIBSIDPLAYFP_VERSION_MAJ < 3 + m_rs.create(m_sidplay.info().maxsids()); + if (!m_rs.getStatus()) + return false; + m_rs.filter(true); + cfg.playback = isStereo ? SidConfig::STEREO : SidConfig::MONO; +#endif if (!m_sidplay.config(cfg)) return false; @@ -253,7 +269,10 @@ bool SIDPlay::open(const QString &_url, bool tracksOnly) streams_info += new StreamInfo(m_srate, m_chn); - return m_sidplay.load(m_tune); + if (!m_sidplay.load(m_tune)) + return false; + m_sidplay.initMixer(isStereo); + return true; } return false; @@ -269,6 +288,6 @@ QString SIDPlay::getTitle(const SidTuneInfo *info, int track) const else ret = title; if (info->songs() > 1) - return tr("Track") + QString(" %1%2").arg(track + 1).arg(ret.isEmpty() ? QString() : (" - " + ret)); + return tr("Track") + QStringLiteral(" %1%2").arg(track + 1).arg(ret.isEmpty() ? QString() : (" - " + ret)); return ret; } diff --git a/src/modules/Chiptune/SIDPlay.hpp b/src/modules/Chiptune/SIDPlay.hpp index 105b5b686..b9b9feb0b 100644 --- a/src/modules/Chiptune/SIDPlay.hpp +++ b/src/modules/Chiptune/SIDPlay.hpp @@ -20,9 +20,14 @@ #include <Demuxer.hpp> -#include <sidplayfp/builders/residfp.h> #include <sidplayfp/sidplayfp.h> +#if LIBSIDPLAYFP_VERSION_MAJ >= 3 +#include <sidplayfp/builders/sidlite.h> +#else +#include <sidplayfp/builders/residfp.h> +#endif + class SidTuneInfo; class Reader; @@ -65,7 +70,13 @@ class SIDPlay final : public Demuxer QList<QMPlay2Tag> m_tags; QString m_url, m_title; + QByteArray m_mixBuf; + +#if LIBSIDPLAYFP_VERSION_MAJ >= 3 + SIDLiteBuilder m_rs; +#else ReSIDfpBuilder m_rs; +#endif sidplayfp m_sidplay; SidTune *m_tune; };
