mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Fixed race condition in AudioEngine.
This commit is contained in:
@@ -525,12 +525,12 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
|
|||||||
|
|
||||||
if ( oldState == Phonon::PlayingState )
|
if ( oldState == Phonon::PlayingState )
|
||||||
{
|
{
|
||||||
qint64 duration = m_mediaObject->totalTime() > 0 ? m_mediaObject->totalTime() : m_currentTrack->duration() * 1000;
|
|
||||||
bool stopped = false;
|
bool stopped = false;
|
||||||
switch ( newState )
|
switch ( newState )
|
||||||
{
|
{
|
||||||
case Phonon::PausedState:
|
case Phonon::PausedState:
|
||||||
{
|
{
|
||||||
|
qint64 duration = m_mediaObject->totalTime() > 0 ? m_mediaObject->totalTime() : m_currentTrack->duration() * 1000;
|
||||||
stopped = ( duration - 1000 < m_mediaObject->currentTime() );
|
stopped = ( duration - 1000 < m_mediaObject->currentTime() );
|
||||||
if ( !stopped )
|
if ( !stopped )
|
||||||
setState( Paused );
|
setState( Paused );
|
||||||
|
Reference in New Issue
Block a user