Unverified Commit a8d3c039 authored by Wolle's avatar Wolle Committed by GitHub

Add files via upload

terminate VORBIS COMMENT

add debug function in processwebstream()
parent 337c3cbf
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Audio.cpp * Audio.cpp
* *
* Created on: Oct 26,2018 * Created on: Oct 26,2018
* Updated on: May 18,2022 * Updated on: May 20,2022
* Author: Wolle (schreibfaul1) * Author: Wolle (schreibfaul1)
* *
*/ */
...@@ -1333,6 +1333,9 @@ int Audio::read_FLAC_Header(uint8_t *data, size_t len) { ...@@ -1333,6 +1333,9 @@ int Audio::read_FLAC_Header(uint8_t *data, size_t len) {
if(offset >= 0){ if(offset >= 0){
sprintf(chbuf, "%s: %s", fn[i], data + offset + strlen(fn[i]) + 1); sprintf(chbuf, "%s: %s", fn[i], data + offset + strlen(fn[i]) + 1);
chbuf[strlen(chbuf) - 1] = 0; chbuf[strlen(chbuf) - 1] = 0;
for(int i=0; i<strlen(chbuf);i++){
if(chbuf[i] == 255) chbuf[i] = 0;
}
if(audio_id3data) audio_id3data(chbuf); if(audio_id3data) audio_id3data(chbuf);
} }
} }
...@@ -3042,6 +3045,24 @@ void Audio::processWebStream() { ...@@ -3042,6 +3045,24 @@ void Audio::processWebStream() {
availableBytes = _client->available(); // available from stream availableBytes = _client->available(); // available from stream
if(ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG){
// Here you can see how much data comes in, a summary is displayed in every 10 calls
static uint8_t i = 0;
static uint32_t t = 0;
static uint32_t t0 = 0;
static uint16_t avb[10];
if(!i) t = millis();
avb[i] = availableBytes;
if(!avb[i]){if(!t0) t0 = millis();}
else{if(t0 && (millis() - t0) > 400) log_d("\033[31m%dms no data received", millis() - t0); t0 = 0;}
i++;
if(i == 10) i = 0;
if(!i){
log_d("bytes available, 10 polls in %dms %d, %d, %d, %d, %d, %d, %d, %d, %d, %d", millis() - t,
avb[0], avb[1], avb[2], avb[3], avb[4], avb[5], avb[6], avb[7], avb[8], avb[9]);
}
}
// if we have chunked data transfer: get the chunksize- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // if we have chunked data transfer: get the chunksize- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if(m_f_chunked && !m_chunkcount && availableBytes) { // Expecting a new chunkcount? if(m_f_chunked && !m_chunkcount && availableBytes) { // Expecting a new chunkcount?
int b; int b;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment