1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 00:54:20 +02: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 )
setState( Playing );
if ( !m_expectStop )
return;
m_expectStop = false;
if ( oldState == Phonon::PlayingState )
{
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:
{
stopped = ( duration - 1000 < m_mediaObject->currentTime() );
if ( !stopped )
setState( Paused );
@@ -548,8 +543,9 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
break;
}
if ( stopped )
if ( stopped && m_expectStop )
{
m_expectStop = false;
qDebug() << "Loading next track.";
loadNextTrack();
}

View File

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