mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Fixed GStreamer skipping to the next track on pausing.
This commit is contained in:
@@ -520,7 +520,25 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
|
|||||||
|
|
||||||
if ( oldState == Phonon::PlayingState )
|
if ( oldState == Phonon::PlayingState )
|
||||||
{
|
{
|
||||||
if ( newState == Phonon::PausedState || newState == Phonon::StoppedState )
|
qint64 duration = m_mediaObject->totalTime() > 0 ? m_mediaObject->totalTime() : m_currentTrack->duration() * 1000;
|
||||||
|
bool stopped = false;
|
||||||
|
switch ( newState )
|
||||||
|
{
|
||||||
|
case Phonon::PausedState:
|
||||||
|
{
|
||||||
|
stopped = ( duration - 1000 < m_mediaObject->currentTime() );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Phonon::StoppedState:
|
||||||
|
{
|
||||||
|
stopped = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( stopped )
|
||||||
{
|
{
|
||||||
qDebug() << "Loading next track.";
|
qDebug() << "Loading next track.";
|
||||||
loadNextTrack();
|
loadNextTrack();
|
||||||
|
@@ -105,7 +105,7 @@ Database::enqueue( QSharedPointer<DatabaseCommand> lc )
|
|||||||
happyThread = worker;
|
happyThread = worker;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "Enqueueing command to thread:" << happyThread << busyThreads << lc->commandname();
|
// qDebug() << "Enqueueing command to thread:" << happyThread << busyThreads << lc->commandname();
|
||||||
happyThread->enqueue( lc );
|
happyThread->enqueue( lc );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user