Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package elisa for openSUSE:Factory checked 
in at 2024-04-02 16:43:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/elisa (Old)
 and      /work/SRC/openSUSE:Factory/.elisa.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "elisa"

Tue Apr  2 16:43:07 2024 rev:63 rq:1163932 version:24.02.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/elisa/elisa.changes      2024-03-22 
15:28:49.831050667 +0100
+++ /work/SRC/openSUSE:Factory/.elisa.new.1905/elisa.changes    2024-04-02 
16:44:59.674684459 +0200
@@ -1,0 +2,6 @@
+Sat Mar 30 10:51:19 UTC 2024 - Dmitry Roshchin <[email protected]>
+
+-  Fix qt multimedia backend stopping playback after a track has finished
+  elisa-qtmultimedia.patch
+
+-------------------------------------------------------------------

New:
----
  elisa-qtmultimedia.patch

BETA DEBUG BEGIN:
  New:-  Fix qt multimedia backend stopping playback after a track has finished
  elisa-qtmultimedia.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ elisa.spec ++++++
--- /var/tmp/diff_new_pack.nAYyFh/_old  2024-04-02 16:45:00.274705877 +0200
+++ /var/tmp/diff_new_pack.nAYyFh/_new  2024-04-02 16:45:00.278706020 +0200
@@ -31,6 +31,8 @@
 Source1:        %{name}-%{version}.tar.xz.sig
 Source2:        applications.keyring
 %endif
+# PATCH-FIX-UPSTREAM elisa-qtmultimedia.patch
+Patch1:         elisa-qtmultimedia.patch
 BuildRequires:  kf6-extra-cmake-modules >= %{kf6_version}
 BuildRequires:  qt6-core-private-devel >= %{qt6_version}
 BuildRequires:  cmake(KF6Baloo) >= %{kf6_version}
@@ -93,7 +95,6 @@
 
 %find_lang %{name} --with-man --with-html --all-name
 
-
 %files
 %license LICENSES/*
 %doc README.md



++++++ elisa-qtmultimedia.patch ++++++
>From f110ef437587dceda1ca0e89b83576a1da092765 Mon Sep 17 00:00:00 2001
From: Jack Hill <[email protected]>
Date: Wed, 14 Feb 2024 14:00:59 +0000
Subject: [PATCH] Fix qt multimedia backend stopping playback after a track has
 finished

When reaching the end of a track the QMediaPlayer first sets
playbackState to Stopped and then sets mediaStatus to EndOfMedia.

The ManageAudioPlayer class is currently designed to handle changes the
other way round because that's how the old Qt5 backend worked. I.e. set
EndOfMedia first and then set Stopped. This meant the audio player would
first see the Stopped signal and did not know that we should start
playing the next track immediately.

Now we cache the signals from QMediaPlayer and emit them in the order
expected by ManageAudioPlayer.
---
 src/audiowrapper.h                |  4 ++++
 src/audiowrapper_qtmultimedia.cpp | 37 ++++++++++++++++++++++++++-----
 2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/audiowrapper.h b/src/audiowrapper.h
index f0be2d40..8d02beff 100644
--- a/src/audiowrapper.h
+++ b/src/audiowrapper.h
@@ -165,6 +165,10 @@ private Q_SLOTS:
 
     void playerSeekableSignalChanges(bool isSeekable);
 
+    void queueStatusChanged();
+
+    void notifyStatusChanges();
+
     friend class AudioWrapperPrivate;
 
     std::unique_ptr<AudioWrapperPrivate> d;
diff --git a/src/audiowrapper_qtmultimedia.cpp 
b/src/audiowrapper_qtmultimedia.cpp
index 6e085ffe..fdf762f1 100644
--- a/src/audiowrapper_qtmultimedia.cpp
+++ b/src/audiowrapper_qtmultimedia.cpp
@@ -32,6 +32,11 @@ class AudioWrapperPrivate
 
     bool mHasSavedPosition = false;
 
+    QMediaPlayer::PlaybackState mCurrentPlaybackState = 
mPlayer.playbackState();
+
+    QMediaPlayer::MediaStatus mCurrentMediaStatus = mPlayer.mediaStatus();
+
+    bool mQueuedStatusUpdate = false;
 };
 
 AudioWrapper::AudioWrapper(QObject *parent) : QObject(parent), 
d(std::make_unique<AudioWrapperPrivate>())
@@ -40,10 +45,9 @@ AudioWrapper::AudioWrapper(QObject *parent) : 
QObject(parent), d(std::make_uniqu
     connect(&d->mOutput, &QAudioOutput::mutedChanged, this, 
&AudioWrapper::playerMutedChanged);
     connect(&d->mOutput, &QAudioOutput::volumeChanged, this, 
&AudioWrapper::playerVolumeChanged);
     connect(&d->mPlayer, &QMediaPlayer::sourceChanged, this, 
&AudioWrapper::sourceChanged);
-    connect(&d->mPlayer, &QMediaPlayer::playbackStateChanged, this, 
&AudioWrapper::playbackStateChanged);
-    connect(&d->mPlayer, &QMediaPlayer::playbackStateChanged, this, 
&AudioWrapper::playerStateChanged);
+    connect(&d->mPlayer, &QMediaPlayer::playbackStateChanged, this, 
&AudioWrapper::queueStatusChanged);
     connect(&d->mPlayer, QOverload<QMediaPlayer::Error, const QString 
&>::of(&QMediaPlayer::errorOccurred), this, &AudioWrapper::errorChanged);
-    connect(&d->mPlayer, &QMediaPlayer::mediaStatusChanged, this, 
&AudioWrapper::statusChanged);
+    connect(&d->mPlayer, &QMediaPlayer::mediaStatusChanged, this, 
&AudioWrapper::queueStatusChanged);
     connect(&d->mPlayer, &QMediaPlayer::mediaStatusChanged, this, 
&AudioWrapper::mediaStatusChanged);
     connect(&d->mPlayer, &QMediaPlayer::durationChanged, this, 
&AudioWrapper::durationChanged);
     connect(&d->mPlayer, &QMediaPlayer::positionChanged, this, 
&AudioWrapper::positionChanged);
@@ -99,12 +103,12 @@ bool AudioWrapper::seekable() const
 
 QMediaPlayer::PlaybackState AudioWrapper::playbackState() const
 {
-    return d->mPlayer.playbackState();
+    return d->mCurrentPlaybackState;
 }
 
 QMediaPlayer::MediaStatus AudioWrapper::status() const
 {
-    return d->mPlayer.mediaStatus();
+    return d->mCurrentMediaStatus;
 }
 
 void AudioWrapper::setMuted(bool muted)
@@ -289,5 +293,28 @@ void AudioWrapper::savePosition(qint64 position)
     }
 }
 
+void AudioWrapper::notifyStatusChanges()
+{
+    d->mQueuedStatusUpdate = false;
+
+    if (d->mPlayer.mediaStatus() != d->mCurrentMediaStatus) {
+        d->mCurrentMediaStatus = d->mPlayer.mediaStatus();
+        Q_EMIT statusChanged(d->mCurrentMediaStatus);
+    }
+    if (d->mPlayer.playbackState() != d->mCurrentPlaybackState) {
+        d->mCurrentPlaybackState = d->mPlayer.playbackState();
+        Q_EMIT playbackStateChanged(d->mCurrentPlaybackState);
+        playerStateChanged();
+    }
+}
+
+void AudioWrapper::queueStatusChanged()
+{
+    if (!d->mQueuedStatusUpdate) {
+        QTimer::singleShot(0, this, &AudioWrapper::notifyStatusChanges);
+        d->mQueuedStatusUpdate = true;
+    }
+}
+
 
 #include "moc_audiowrapper.cpp"

Reply via email to