1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 15:47:38 +02:00

* Change AudioEngine's state before emitting the signal.

This commit is contained in:
Christian Muehlhaeuser
2013-06-15 11:25:49 +02:00
parent 4d7efe82a2
commit 633350660e

View File

@@ -81,14 +81,17 @@ AudioEnginePrivate::onStateChanged( Phonon::State newState, Phonon::State oldSta
} }
if ( newState == Phonon::PlayingState ) if ( newState == Phonon::PlayingState )
{ {
bool emitSignal = false;
if ( q_ptr->state() != AudioEngine::Paused && q_ptr->state() != AudioEngine::Playing ) if ( q_ptr->state() != AudioEngine::Paused && q_ptr->state() != AudioEngine::Playing )
{ {
underrunCount = 0; underrunCount = 0;
underrunNotified = false; underrunNotified = false;
emit q_ptr->started( currentTrack ); emitSignal = true;
} }
q_ptr->setState( AudioEngine::Playing ); q_ptr->setState( AudioEngine::Playing );
if ( emitSignal )
emit q_ptr->started( currentTrack );
} }
if ( newState == Phonon::StoppedState && oldState == Phonon::PausedState ) if ( newState == Phonon::StoppedState && oldState == Phonon::PausedState )
{ {