From 33614533d8a9fec2403cf748b6fe8392c3de6625 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Wed, 19 May 2010 13:08:52 +0000 Subject: [PATCH] Fix playlist wrapping into a last.fm stream, for real this time. --- src/core/player.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/player.cpp b/src/core/player.cpp index a96c81fb9..c8abd4ef0 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -575,10 +575,18 @@ void Player::TrackAboutToEnd() { // Get the actual track URL rather than the stream URL. if (item->options() & PlaylistItem::ContainsMultipleTracks) { PlaylistItem::SpecialLoadResult result = item->LoadNext(); - if (result.type_ != PlaylistItem::SpecialLoadResult::TrackAvailable) + switch (result.type_) { + case PlaylistItem::SpecialLoadResult::NoMoreTracks: return; - url = result.media_url_; + case PlaylistItem::SpecialLoadResult::WillLoadAsynchronously: + loading_async_ = item->Url(); + return; + + case PlaylistItem::SpecialLoadResult::TrackAvailable: + url = result.media_url_; + break; + } } engine_->StartPreloading(url); }