From 4fc99ce88f30f227e959af2d232ea43fb34fffc1 Mon Sep 17 00:00:00 2001 From: Tobias Guyer Date: Sun, 21 Jul 2024 11:49:09 +0200 Subject: [PATCH] changed the track feedback a little, so it'll skip to the next track if there are any missreads in the stream --- cspot/src/TrackPlayer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cspot/src/TrackPlayer.cpp b/cspot/src/TrackPlayer.cpp index 0fb61e2..4e542ac 100644 --- a/cspot/src/TrackPlayer.cpp +++ b/cspot/src/TrackPlayer.cpp @@ -132,6 +132,7 @@ void TrackPlayer::runTask() { bool endOfQueueReached = false; while (isRunning) { + bool properStream = true; // Ensure we even have any tracks to play if (!this->trackQueue->hasTracks() || (!pendingReset && endOfQueueReached && trackQueue->isFinished())) { @@ -297,6 +298,7 @@ void TrackPlayer::runTask() { if (ret < 0) { CSPOT_LOG(error, "An error has occured in the stream %d", ret); currentSongPlaying = false; + properStream = false; } else { if (ret == 0) { CSPOT_LOG(info, "EOF"); @@ -352,9 +354,8 @@ void TrackPlayer::runTask() { if (trackQueue->isFinished()) { endOfQueueReached = true; } - - this->eofCallback(true); } + this->eofCallback(properStream); } }