mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 02:24:50 +02:00
* Fixed AudioEngine crashing when GStreamer goes to its weird Paused state.
This commit is contained in:
@@ -733,9 +733,15 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
|
|||||||
switch ( newState )
|
switch ( newState )
|
||||||
{
|
{
|
||||||
case Phonon::PausedState:
|
case Phonon::PausedState:
|
||||||
|
{
|
||||||
|
if ( m_mediaObject && m_currentTrack )
|
||||||
{
|
{
|
||||||
qint64 duration = m_mediaObject->totalTime() > 0 ? m_mediaObject->totalTime() : m_currentTrack->duration() * 1000;
|
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() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
stopped = true;
|
||||||
|
|
||||||
if ( !stopped )
|
if ( !stopped )
|
||||||
setState( Paused );
|
setState( Paused );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user