From e356d41c1b9bcd00b1ffffae08bc13ae689180bd Mon Sep 17 00:00:00 2001 From: pitlochry <41258895+pitlochry@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:38:01 +0100 Subject: [PATCH] Partly revert: Fix webstream playlist abort when track fails (#276), af0b078 (#285) Some properties like repeatCurrentTrack, repeatPlaylist, sleepAfterCurrentTrack, sleepAfterPlaylist, saveLastPlayPosition got lost with https://github.com/biologist79/ESPuino/commit/af0b07801194b55a6ccdfa3c2f7da1ab7e615600 See also https://forum.espuino.de/t/3-bugs-in-audioplayer-cpp-hoerbuchmodus-speichern-der-playposition-sleepafter/2456/3?u=sfields --- src/AudioPlayer.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/AudioPlayer.cpp b/src/AudioPlayer.cpp index f0bcafb9..1988c797 100644 --- a/src/AudioPlayer.cpp +++ b/src/AudioPlayer.cpp @@ -422,12 +422,6 @@ void AudioPlayer_Task(void *parameter) { Log_Printf(LOGLEVEL_DEBUG, "Free heap: %u", ESP.getFreeHeap()); playbackTimeoutStart = millis(); gPlayProperties.pausePlay = false; - gPlayProperties.repeatCurrentTrack = false; - gPlayProperties.repeatPlaylist = false; - gPlayProperties.sleepAfterCurrentTrack = false; - gPlayProperties.sleepAfterPlaylist = false; - gPlayProperties.saveLastPlayPosition = false; - gPlayProperties.playUntilTrackNumber = 0; gPlayProperties.trackFinished = false; gPlayProperties.playlistFinished = false; @@ -1011,6 +1005,13 @@ void AudioPlayer_TrackQueueDispatcher(const char *_itemToPlay, const uint32_t _l gPlayProperties.playMode = _playMode; gPlayProperties.numberOfTracks = strtoul(*(musicFiles - 1), NULL, 10); + // Set some default-values + gPlayProperties.repeatCurrentTrack = false; + gPlayProperties.repeatPlaylist = false; + gPlayProperties.sleepAfterCurrentTrack = false; + gPlayProperties.sleepAfterPlaylist = false; + gPlayProperties.saveLastPlayPosition = false; + gPlayProperties.playUntilTrackNumber = 0; #ifdef PLAY_LAST_RFID_AFTER_REBOOT // Store last RFID-tag to NVS