Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
2.03k
stars
432
forks
source link
Lot of disconnects and mp3 errors in AudioFileSourceICYStream #577
I did get a lot of disconnects and reconnects on slow ICY servers in the AudioFileSourceICYStream class.
Found the problem in readInternal(...) function, when there is no data available (in blocking mode) in the stream the code will do a retry. Only, in the retry loop, it call's http.end() to disconnect the stream, that is not OK, keep the stream open and retry will work...
size_t avail = stream->available();
if (!nonBlock && !avail) {
cb.st(STATUS_NODATA, PSTR("No stream data available"));
// Wrong, don't terminate the stream when there is no data yet!
// http.end();
goto retry;
}
Hi there,
I did get a lot of disconnects and reconnects on slow ICY servers in the AudioFileSourceICYStream class. Found the problem in readInternal(...) function, when there is no data available (in blocking mode) in the stream the code will do a retry. Only, in the retry loop, it call's http.end() to disconnect the stream, that is not OK, keep the stream open and retry will work...
Also add some more ICY header tokens, like it:
73