Skip to content

Commit 7d38bb4

Browse files
Fixed c1ccce3.
Stop songs only on a new url OR if playback starts at the first byte.
1 parent ff5a467 commit 7d38bb4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ESP32_VS1053_Stream.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,11 @@ bool ESP32_VS1053_Stream::connecttohost(const char *url, const char *username,
340340
_musicDataPosition = _metaDataStart ? 0 : -100;
341341
_bitrate = _http->header(BITRATE).toInt();
342342
_url[0] = _savedStartChar;
343-
if (strcmp(_url, url)) /* 0 means strings are equal*/
343+
if (strcmp(_url, url) || !_offset)
344344
{
345345
_vs1053->stopSong();
346346
snprintf(_url, sizeof(_url), "%s", url);
347+
log_i("stream stopped");
347348
}
348349
_streamStalledTime = 0;
349350
log_d("redirected %i times", _redirectCount);

0 commit comments

Comments
 (0)