1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-22 17:01:51 +02:00

Stop the audio output as soon as we try to load a new track.

This commit is contained in:
Christian Muehlhaeuser 2015-04-18 09:45:04 +02:00
parent de8dcce45e
commit d50104cce7

@ -559,12 +559,19 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
Q_D( AudioEngine );
tDebug( LOGEXTRA ) << Q_FUNC_INFO << ( result.isNull() ? QString() : result->url() );
if ( result.isNull() )
if ( !result )
{
stop();
return;
}
// We do this to stop the audio as soon as a user activated another track
// If we don't block the audioOutput signals, the state change will trigger
// loading yet another track
d->audioOutput->blockSignals( true );
d->audioOutput->stop();
d->audioOutput->blockSignals( false );
setCurrentTrack( result );
if ( !TomahawkUtils::isLocalResult( d->currentTrack->url() ) && !TomahawkUtils::isHttpResult( d->currentTrack->url() )