diff --git a/src/core/player.cpp b/src/core/player.cpp index 224fc495e..78521e12e 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -423,6 +423,13 @@ void Player::TrackAboutToEnd() { if (engine_->is_autocrossfade_enabled()) { // Crossfade is on, so just start playing the next track. The current one // will fade out, and the new one will fade in + + // But, if there's no next track and we don't want to fade out, then do + // nothing and just let the track finish to completion. + if (!engine_->is_fadeout_enabled() && + playlists_->active()->next_index() == -1) + return; + NextInternal(Engine::Auto); } else { // Crossfade is off, so start preloading the next track so we don't get a diff --git a/src/engines/enginebase.h b/src/engines/enginebase.h index 15a41397d..9cd23aea6 100644 --- a/src/engines/enginebase.h +++ b/src/engines/enginebase.h @@ -69,6 +69,7 @@ class Base : public QObject, boost::noncopyable { // Simple accessors inline uint volume() const { return volume_; } virtual const Scope &scope() { return scope_; } + bool is_fadeout_enabled() const { return fadeout_enabled_; } bool is_crossfade_enabled() const { return crossfade_enabled_; } bool is_autocrossfade_enabled() const { return autocrossfade_enabled_; }