From 2aa237342cd7880b86647e27405447f9bc6a1861 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Mon, 12 Apr 2021 22:25:52 +0200 Subject: [PATCH] Minor tweak to let MPRIS2 load the correct track info on startup It's still crashing without a proper track being loaded on startup. Still needs to be resolved. --- src/mpris2/mediaplayer2player.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mpris2/mediaplayer2player.cpp b/src/mpris2/mediaplayer2player.cpp index 31e77762..30c8d5c2 100644 --- a/src/mpris2/mediaplayer2player.cpp +++ b/src/mpris2/mediaplayer2player.cpp @@ -55,6 +55,9 @@ MediaPlayer2Player::MediaPlayer2Player(AudioManager *audioPlayer, bool showProgr signalPropertiesChange(QStringLiteral("Volume"), Volume()); m_mediaPlayerPresent = 1; + if (m_audioPlayer->entry()) { + setCurrentTrack(DataManager::instance().getQueue().indexOf(m_audioPlayer->entry()->id())); + } } MediaPlayer2Player::~MediaPlayer2Player()