From 14c5a92ba25f0c0909f5c971dc807a7585432296 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 1 Jul 2014 21:28:45 +0100 Subject: [PATCH] Only start track from the correct thread --- src/libtomahawk/audio/AudioEngine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libtomahawk/audio/AudioEngine.cpp b/src/libtomahawk/audio/AudioEngine.cpp index c557a2293..21ba7d6c5 100644 --- a/src/libtomahawk/audio/AudioEngine.cpp +++ b/src/libtomahawk/audio/AudioEngine.cpp @@ -701,6 +701,16 @@ AudioEngine::performLoadIODevice( const result_ptr& result, const QString& url ) void AudioEngine::performLoadTrack( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io ) { + if ( QThread::currentThread() != thread() ) + { + QMetaObject::invokeMethod( this, "performLoadTrack", Qt::QueuedConnection, + Q_ARG( const Tomahawk::result_ptr, result ), + Q_ARG( const QString, url ), + Q_ARG( QSharedPointer< QIODevice >, io ) + ); + return; + } + Q_D( AudioEngine ); if ( currentTrack() != result ) {