Skip to content

Commit

Permalink
Problem with a certain FLAC stream #902
Browse files Browse the repository at this point in the history
  • Loading branch information
schreibfaul1 committed Nov 11, 2024
1 parent d7a38e9 commit f831684
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ void Audio::setDefaults() {
m_f_ts = false;
m_f_m4aID3dataAreRead = false;
m_f_stream = false;
m_f_decode_ready = false;
m_f_eof = false;
m_f_ID3v1TagFound = false;
m_f_lockInBuffer = false;
Expand Down Expand Up @@ -4359,6 +4360,7 @@ int Audio::findNextSync(uint8_t* data, size_t len) {
}
else {
if(audio_info) audio_info("syncword found at pos 0");
m_f_decode_ready = true;
}
}
if(nextSync > 0) { AUDIO_INFO("syncword found at pos %i", nextSync); }
Expand Down Expand Up @@ -4439,6 +4441,7 @@ int Audio::sendBytes(uint8_t* data, size_t len) {
int bytesDecoded = 0;

if(m_codec == CODEC_NONE && m_playlistFormat == FORMAT_M3U8) return 0; // can happen when the m3u8 playlist is loaded
if(!m_f_decode_ready) return 0; // find sync first

switch(m_codec) {
case CODEC_WAV: m_decodeError = 0; bytesLeft = 0; break;
Expand Down
1 change: 1 addition & 0 deletions src/Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ uint64_t bigEndian(uint8_t* base, uint8_t numBytes, uint8_t shiftLeft = 8) {
bool m_f_commFMT = false; // false: default (PHILIPS), true: Least Significant Bit Justified (japanese format)
bool m_f_audioTaskIsRunning = false;
bool m_f_stream = false; // stream ready for output?
bool m_f_decode_ready = false; // if true data for decode are ready
bool m_f_eof = false; // end of file
bool m_f_lockInBuffer = false; // lock inBuffer for manipulation
bool m_f_audioTaskIsDecoding = false;
Expand Down

0 comments on commit f831684

Please sign in to comment.