diff --git a/src/Audio.cpp b/src/Audio.cpp index 9aa2caa3..e8bac13f 100644 --- a/src/Audio.cpp +++ b/src/Audio.cpp @@ -3,7 +3,7 @@ * * Created on: Oct 27.2018 * - * Version 3.0.12q + * Version 3.0.12r * Updated on: Sep 22.2024 * Author: Wolle (schreibfaul1) * @@ -3158,7 +3158,7 @@ void Audio::processLocalFile() { m_f_running = false; return; } - if(InBuff.bufferFilled() > maxFrameSize) { // read the file header first + if(InBuff.bufferFilled() > maxFrameSize || (InBuff.bufferFilled() == m_fileSize)) { // at least one complete frame or the file is smaller InBuff.bytesWasRead(readAudioHeader(InBuff.getMaxAvailableBytes())); } return; @@ -3354,7 +3354,7 @@ void Audio::processWebFile() { // we have a webfile, read the file header first - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if(m_controlCounter != 100) { - if(InBuff.bufferFilled() > maxFrameSize) { // read the file header first + if(InBuff.bufferFilled() > maxFrameSize || (InBuff.bufferFilled() == m_contentlength)) { // at least one complete frame or the file is smaller int32_t bytesRead = readAudioHeader(InBuff.getMaxAvailableBytes()); if(bytesRead > 0) InBuff.bytesWasRead(bytesRead); }