mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Stop the audio output as soon as we try to load a new track.
This commit is contained in:
@@ -559,12 +559,19 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
|
|||||||
Q_D( AudioEngine );
|
Q_D( AudioEngine );
|
||||||
tDebug( LOGEXTRA ) << Q_FUNC_INFO << ( result.isNull() ? QString() : result->url() );
|
tDebug( LOGEXTRA ) << Q_FUNC_INFO << ( result.isNull() ? QString() : result->url() );
|
||||||
|
|
||||||
if ( result.isNull() )
|
if ( !result )
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
return;
|
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 );
|
setCurrentTrack( result );
|
||||||
|
|
||||||
if ( !TomahawkUtils::isLocalResult( d->currentTrack->url() ) && !TomahawkUtils::isHttpResult( d->currentTrack->url() )
|
if ( !TomahawkUtils::isLocalResult( d->currentTrack->url() ) && !TomahawkUtils::isHttpResult( d->currentTrack->url() )
|
||||||
|
Reference in New Issue
Block a user