Skip to content

Commit 028a4f3

Browse files
Fixed EOF callback called twice if decoder fails to sync (#96)
1 parent e47e8ee commit 028a4f3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ESP32_VS1053_Stream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ bool ESP32_VS1053_Stream::connectToHost(const char *url, const char *username,
252252
bool isHttps = (length > 4 && tolower(url[4]) == 's');
253253

254254
_http->setConnectTimeout(isHttps ? VS1053_CONNECT_TIMEOUT_MS_SSL
255-
: VS1053_CONNECT_TIMEOUT_MS);
255+
: VS1053_CONNECT_TIMEOUT_MS);
256256

257257
const char *finalUrl = needsEscape ? reinterpret_cast<const char *>(_localbuffer) : url;
258258
if (!_http->begin(finalUrl))
@@ -954,7 +954,7 @@ void ESP32_VS1053_Stream::_readBitRate()
954954
if (++_decoderSyncAttempts > 4)
955955
{
956956
log_w("decoder failed to sync");
957-
_eofStream();
957+
_remainingBytes = 0;
958958
}
959959
return;
960960
}

0 commit comments

Comments
 (0)