Unverified Commit 73afabe1 authored by Wolle's avatar Wolle Committed by GitHub

AudiobufferSize UINT16_MAX

parent 7d23d28b
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* Created on: Oct 26.2018 * Created on: Oct 26.2018
* *
* Version 3.0.1s * Version 3.0.2
* Updated on: May 03.2023 * Updated on: May 05.2023
* Author: Wolle (schreibfaul1) * Author: Wolle (schreibfaul1)
* *
*/ */
...@@ -1879,16 +1879,19 @@ int Audio::read_M4A_Header(uint8_t *data, size_t len) { ...@@ -1879,16 +1879,19 @@ int Audio::read_M4A_Header(uint8_t *data, size_t len) {
static size_t audioDataPos = 0; static size_t audioDataPos = 0;
if(m_controlCounter == M4A_BEGIN) retvalue = 0; if(m_controlCounter == M4A_BEGIN) retvalue = 0;
static size_t cnt = 0;
if(retvalue) { if(retvalue) {
if(len > InBuff.getMaxBlockSize()) len = InBuff.getMaxBlockSize(); if(len > InBuff.getMaxBlockSize()) len = InBuff.getMaxBlockSize();
if(retvalue > len) { // if returnvalue > bufferfillsize if(retvalue > len) { // if returnvalue > bufferfillsize
retvalue -= len; // and wait for more bufferdata retvalue -= len; // and wait for more bufferdata
cnt += len;
return len; return len;
} }
else { else {
size_t tmp = retvalue; size_t tmp = retvalue;
retvalue = 0; retvalue = 0;
cnt += tmp;
cnt = 0;
return tmp; return tmp;
} }
return 0; return 0;
...@@ -1977,8 +1980,9 @@ int Audio::read_M4A_Header(uint8_t *data, size_t len) { ...@@ -1977,8 +1980,9 @@ int Audio::read_M4A_Header(uint8_t *data, size_t len) {
return 0; return 0;
} }
if (atomsize > len -10){atomsize -= (len -10); headerSize += (len -10); retvalue = (len -10);} m_controlCounter = M4A_CHK;
else {m_controlCounter = M4A_CHK; retvalue = atomsize; headerSize += atomsize;} headerSize += atomsize;
retvalue = atomsize;
return 0; return 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
...@@ -3052,7 +3056,8 @@ void Audio::processWebFile() { ...@@ -3052,7 +3056,8 @@ void Audio::processWebFile() {
// we have a webfile, read the file header first - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // we have a webfile, read the file header first - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if(m_controlCounter != 100){ if(m_controlCounter != 100){
if(InBuff.bufferFilled() > maxFrameSize){ // read the file header first if(InBuff.bufferFilled() > maxFrameSize){ // read the file header first
InBuff.bytesWasRead(readAudioHeader(InBuff.bufferFilled())); // #480 int32_t bytesRead = readAudioHeader(maxFrameSize);
if(bytesRead > 0) InBuff.bytesWasRead(bytesRead);
} }
return; return;
} }
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* Created on: Oct 28,2018 * Created on: Oct 28,2018
* *
* Version 3.0.1r * Version 3.0.2
* Updated on: May 03,2023 * Updated on: May 05,2023
* Author: Wolle (schreibfaul1) * Author: Wolle (schreibfaul1)
*/ */
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
bool havePSRAM() { return m_f_psram; }; bool havePSRAM() { return m_f_psram; };
protected: protected:
size_t m_buffSizePSRAM = 300000; // most webstreams limit the advance to 100...300Kbytes size_t m_buffSizePSRAM = UINT16_MAX; // most webstreams limit the advance to 100...300Kbytes
size_t m_buffSizeRAM = 1600 * 5; size_t m_buffSizeRAM = 1600 * 5;
size_t m_buffSize = 0; size_t m_buffSize = 0;
size_t m_freeSpace = 0; size_t m_freeSpace = 0;
......
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