Skip to content

Commit e4946b9

Browse files
Save url on opening playlist or redirecting (#104)
1 parent 8896c6c commit e4946b9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/ESP32_VS1053_Stream.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ bool ESP32_VS1053_Stream::connectToHost(const char *url, const char *username,
336336
{
337337
if (_isPlaylistContentType())
338338
{
339+
snprintf(_url, sizeof(_url), "%s", url);
340+
339341
if (!_canRedirect())
340342
{
341343
_eofStream();
@@ -350,6 +352,8 @@ bool ESP32_VS1053_Stream::connectToHost(const char *url, const char *username,
350352
stopSong();
351353
return connectToHost(newUrl, username, pwd, offset);
352354
}
355+
356+
// no url found
353357
_eofStream();
354358
_redirectCount = 0;
355359
return false;
@@ -380,6 +384,7 @@ bool ESP32_VS1053_Stream::connectToHost(const char *url, const char *username,
380384
[[fallthrough]];
381385
case 302:
382386
{
387+
snprintf(_url, sizeof(_url), "%s", url);
383388
if (!_canRedirect())
384389
{
385390
_eofStream();

0 commit comments

Comments
 (0)