1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-25 04:13:10 +01:00

* Fixed GStreamer pausing - even more. Sigh for Phonon's states.

This commit is contained in:
Christian Muehlhaeuser 2011-07-21 18:49:04 +02:00
parent 57cdd0d960
commit aa5fb8bc53
2 changed files with 12 additions and 19 deletions

View File

@ -520,10 +520,6 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
if ( newState == Phonon::PlayingState ) if ( newState == Phonon::PlayingState )
setState( Playing ); setState( Playing );
if ( !m_expectStop )
return;
m_expectStop = false;
if ( oldState == Phonon::PlayingState ) if ( oldState == Phonon::PlayingState )
{ {
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;
@ -533,7 +529,6 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
case Phonon::PausedState: case Phonon::PausedState:
{ {
stopped = ( duration - 1000 < m_mediaObject->currentTime() ); stopped = ( duration - 1000 < m_mediaObject->currentTime() );
if ( !stopped ) if ( !stopped )
setState( Paused ); setState( Paused );
@ -548,8 +543,9 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
break; break;
} }
if ( stopped ) if ( stopped && m_expectStop )
{ {
m_expectStop = false;
qDebug() << "Loading next track."; qDebug() << "Loading next track.";
loadNextTrack(); loadNextTrack();
} }

View File

@ -216,14 +216,11 @@ QtScriptResolver::resolve( const Tomahawk::query_ptr& query )
{ {
if ( QThread::currentThread() != thread() ) if ( QThread::currentThread() != thread() )
{ {
// qDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO;
QMetaObject::invokeMethod( this, "resolve", Qt::QueuedConnection, Q_ARG(Tomahawk::query_ptr, query) ); QMetaObject::invokeMethod( this, "resolve", Qt::QueuedConnection, Q_ARG(Tomahawk::query_ptr, query) );
return; return;
} }
qDebug() << Q_FUNC_INFO << "Resolving now with" << m_name << "-" << query->toString();
QString eval; QString eval;
if ( !query->isFullTextQuery() ) if ( !query->isFullTextQuery() )
{ {
eval = QString( RESOLVER_LEGACY_CODE2 "resolver.resolve( '%1', '%2', '%3', '%4' );" ) eval = QString( RESOLVER_LEGACY_CODE2 "resolver.resolve( '%1', '%2', '%3', '%4' );" )