Commit 6c2d027d authored by Michael Pyne's avatar Michael Pyne

Apply patch by Georg Grabler to avoid clearing our m_file in the PlayerManager if we did reach the

StoppedState from LoadingState (which is how Phonon creates its MediaObjects).

I could never reproduce this one but randomly so I'm going to run this some more before I backport.

CCBUG:176329

svn path=/trunk/KDE/kdemultimedia/juk/; revision=913907
parent 562654bd
...@@ -474,7 +474,7 @@ void PlayerManager::slotTick(qint64 msec) ...@@ -474,7 +474,7 @@ void PlayerManager::slotTick(qint64 msec)
m_noSeek = false; m_noSeek = false;
} }
void PlayerManager::slotStateChanged(Phonon::State newstate) void PlayerManager::slotStateChanged(Phonon::State newstate, Phonon::State oldstate)
{ {
if(newstate == Phonon::ErrorState) { if(newstate == Phonon::ErrorState) {
QString errorMessage = QString errorMessage =
...@@ -503,7 +503,7 @@ void PlayerManager::slotStateChanged(Phonon::State newstate) ...@@ -503,7 +503,7 @@ void PlayerManager::slotStateChanged(Phonon::State newstate)
break; break;
} }
} }
else if(newstate == Phonon::StoppedState) { else if(newstate == Phonon::StoppedState && oldstate != Phonon::LoadingState) {
m_playlistInterface->stop(); m_playlistInterface->stop();
m_file = FileHandle::null(); m_file = FileHandle::null();
...@@ -572,7 +572,7 @@ void PlayerManager::setup() ...@@ -572,7 +572,7 @@ void PlayerManager::setup()
m_output = new Phonon::AudioOutput(Phonon::MusicCategory, this); m_output = new Phonon::AudioOutput(Phonon::MusicCategory, this);
m_media = new Phonon::MediaObject(this); m_media = new Phonon::MediaObject(this);
connect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), SLOT(slotStateChanged(Phonon::State))); connect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), SLOT(slotStateChanged(Phonon::State, Phonon::State)));
connect(m_media, SIGNAL(aboutToFinish()), SLOT(slotNeedNextUrl())); connect(m_media, SIGNAL(aboutToFinish()), SLOT(slotNeedNextUrl()));
m_audioPath = Phonon::createPath(m_media, m_output); m_audioPath = Phonon::createPath(m_media, m_output);
m_media->setTickInterval(200); m_media->setTickInterval(200);
...@@ -640,7 +640,7 @@ void PlayerManager::crossfadeToFile(const FileHandle &newFile) ...@@ -640,7 +640,7 @@ void PlayerManager::crossfadeToFile(const FileHandle &newFile)
m_audioPath.insertEffect(m_fader); m_audioPath.insertEffect(m_fader);
// Reconnect everything // Reconnect everything
connect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), SLOT(slotStateChanged(Phonon::State))); connect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), SLOT(slotStateChanged(Phonon::State, Phonon::State)));
connect(m_media, SIGNAL(aboutToFinish()), SLOT(slotNeedNextUrl())); connect(m_media, SIGNAL(aboutToFinish()), SLOT(slotNeedNextUrl()));
if(m_sliderAction->trackPositionSlider()) if(m_sliderAction->trackPositionSlider())
m_sliderAction->trackPositionSlider()->setMediaObject(m_media); m_sliderAction->trackPositionSlider()->setMediaObject(m_media);
......
...@@ -115,7 +115,7 @@ private slots: ...@@ -115,7 +115,7 @@ private slots:
void slotFinished(); void slotFinished();
void slotLength(qint64); void slotLength(qint64);
void slotTick(qint64); void slotTick(qint64);
void slotStateChanged(Phonon::State); void slotStateChanged(Phonon::State, Phonon::State);
void slotKillSender(); // Used to auto-delete media objects at EOF void slotKillSender(); // Used to auto-delete media objects at EOF
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment