1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 00:24:12 +02:00

* Fixed AudioEngine crashing when GStreamer goes to its weird Paused state.

This commit is contained in:
Christian Muehlhaeuser
2012-11-15 17:11:04 +01:00
parent bffd76cb20
commit e7b818e57e

View File

@@ -734,8 +734,14 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
{
case Phonon::PausedState:
{
qint64 duration = m_mediaObject->totalTime() > 0 ? m_mediaObject->totalTime() : m_currentTrack->duration() * 1000;
stopped = ( duration - 1000 < m_mediaObject->currentTime() );
if ( m_mediaObject && m_currentTrack )
{
qint64 duration = m_mediaObject->totalTime() > 0 ? m_mediaObject->totalTime() : m_currentTrack->duration() * 1000;
stopped = ( duration - 1000 < m_mediaObject->currentTime() );
}
else
stopped = true;
if ( !stopped )
setState( Paused );