Skip to content

Commit

Permalink
Playback of small files (less than maxFrameSize) stall and do not play.
Browse files Browse the repository at this point in the history
  • Loading branch information
schreibfaul1 committed Sep 22, 2024
1 parent cf51f5b commit 44b1c52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 44b1c52

Please sign in to comment.