SVN commit 850697 by djones: Try to prevent the engine from enqueuing the next track while in the midst of a track change. I think this will take care of that bug for good. But I realize its a very rare race condition so let me know if it does happen again. CCBUG: 168594 M +9 -2 EngineController.cpp M +1 -0 EngineController.h --- trunk/extragear/multimedia/amarok/src/EngineController.cpp #850696:850697 @@ -62,8 +62,9 @@ EngineController::EngineController() : m_media( 0 ) , m_audio( 0 ) - , m_playWhenFetched(true) + , m_playWhenFetched( true ) , m_fadeoutTimer( new QTimer( this ) ) + , m_trackChangeInProgress( false ) { DEBUG_BLOCK @@ -481,6 +482,8 @@ { play( track ); } + + m_trackChangeInProgress = false; } @@ -540,11 +543,13 @@ EngineController::slotAboutToFinish() { // For some reason, phonon emits this when it's done buffering. - if( m_media->state() == Phonon::BufferingState ) + if( m_trackChangeInProgress || m_media->state() == Phonon::BufferingState ) return; DEBUG_BLOCK + m_trackChangeInProgress = true; + if( m_multi ) { m_mutex.lock(); @@ -651,6 +656,8 @@ playUrl( url, 0 ); m_mutex.unlock(); } + + m_trackChangeInProgress = false; } void --- trunk/extragear/multimedia/amarok/src/EngineController.h #850696:850697 @@ -145,6 +145,7 @@ QTimer* m_fadeoutTimer; QMutex m_mutex; + bool m_trackChangeInProgress; }; namespace The {