Commit c14b9db9 authored by schreibfaul1's avatar schreibfaul1

first changes

parent f72086a1
...@@ -605,7 +605,7 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) { ...@@ -605,7 +605,7 @@ bool Audio::connecttohost(const char* host, const char* user, const char* pwd) {
m_expectedPlsFmt = FORMAT_NONE; m_expectedPlsFmt = FORMAT_NONE;
if(res) { if(res) {
log_i("connecttohost(): %s", rqh); // log_i("connecttohost(): %s", rqh);
_client->print(rqh); _client->print(rqh);
if(endsWith(extension, ".mp3" )) m_expectedCodec = CODEC_MP3; if(endsWith(extension, ".mp3" )) m_expectedCodec = CODEC_MP3;
if(endsWith(extension, ".aac" )) m_expectedCodec = CODEC_AAC; if(endsWith(extension, ".aac" )) m_expectedCodec = CODEC_AAC;
...@@ -3033,6 +3033,7 @@ void Audio::processLocalFile() { ...@@ -3033,6 +3033,7 @@ void Audio::processLocalFile() {
stopSong(); stopSong();
return; return;
} }
m_controlCounter = 100;
if(m_controlCounter != 100) { if(m_controlCounter != 100) {
if((millis() - ctime) > timeout) { if((millis() - ctime) > timeout) {
log_e("audioHeader reading timeout"); log_e("audioHeader reading timeout");
...@@ -4261,8 +4262,10 @@ int Audio::findNextSync(uint8_t* data, size_t len) { ...@@ -4261,8 +4262,10 @@ int Audio::findNextSync(uint8_t* data, size_t len) {
nextSync = 0; nextSync = 0;
} }
if(m_codec == CODEC_FLAC) { if(m_codec == CODEC_FLAC) {
nextSync = OPUSFindSyncWord(data, len);
if(nextSync == -1) return len; // OggS not found, search next block
FLACSetRawBlockParams(m_flacNumChannels, m_flacSampleRate, m_flacBitsPerSample, m_flacTotalSamplesInStream, m_audioDataSize); FLACSetRawBlockParams(m_flacNumChannels, m_flacSampleRate, m_flacBitsPerSample, m_flacTotalSamplesInStream, m_audioDataSize);
nextSync = FLACFindSyncWord(data, len); //nextSync = FLACFindSyncWord(data, len);
} }
if(m_codec == CODEC_OPUS) { if(m_codec == CODEC_OPUS) {
nextSync = OPUSFindSyncWord(data, len); nextSync = OPUSFindSyncWord(data, len);
......
...@@ -337,7 +337,7 @@ private: ...@@ -337,7 +337,7 @@ private:
} }
int specialIndexOf (uint8_t* base, const char* str, int baselen, bool exact = false){ int specialIndexOf (uint8_t* base, const char* str, int baselen, bool exact = false){
int result = 0; // seek for str in buffer or in header up to baselen, not nullterninated int result = -1; // seek for str in buffer or in header up to baselen, not nullterninated
if (strlen(str) > baselen) return -1; // if exact == true seekstr in buffer must have "\0" at the end if (strlen(str) > baselen) return -1; // if exact == true seekstr in buffer must have "\0" at the end
for (int i = 0; i < baselen - strlen(str); i++){ for (int i = 0; i < baselen - strlen(str); i++){
result = i; result = i;
......
This diff is collapsed.
...@@ -150,6 +150,7 @@ boolean FLACFindMagicWord(unsigned char* buf, int nBytes); ...@@ -150,6 +150,7 @@ boolean FLACFindMagicWord(unsigned char* buf, int nBytes);
char* FLACgetStreamTitle(); char* FLACgetStreamTitle();
int FLACparseOGG(uint8_t *inbuf, int *bytesLeft); int FLACparseOGG(uint8_t *inbuf, int *bytesLeft);
bool FLACDecoder_AllocateBuffers(void); bool FLACDecoder_AllocateBuffers(void);
void FLACDecoder_setDefaults();
void FLACDecoder_ClearBuffer(); void FLACDecoder_ClearBuffer();
void FLACDecoder_FreeBuffers(); void FLACDecoder_FreeBuffers();
void FLACSetRawBlockParams(uint8_t Chans, uint32_t SampRate, uint8_t BPS, uint32_t tsis, uint32_t AuDaLength); void FLACSetRawBlockParams(uint8_t Chans, uint32_t SampRate, uint8_t BPS, uint32_t tsis, uint32_t AuDaLength);
......
...@@ -811,7 +811,7 @@ int OPUSFindSyncWord(unsigned char *buf, int nBytes){ ...@@ -811,7 +811,7 @@ int OPUSFindSyncWord(unsigned char *buf, int nBytes){
} }
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
int OPUS_specialIndexOf(uint8_t* base, const char* str, int baselen, bool exact){ int OPUS_specialIndexOf(uint8_t* base, const char* str, int baselen, bool exact){
int result; // seek for str in buffer or in header up to baselen, not nullterninated int result = -1; // seek for str in buffer or in header up to baselen, not nullterninated
if (strlen(str) > baselen) return -1; // if exact == true seekstr in buffer must have "\0" at the end if (strlen(str) > baselen) return -1; // if exact == true seekstr in buffer must have "\0" at the end
for (int i = 0; i < baselen - strlen(str); i++){ for (int i = 0; i < baselen - strlen(str); i++){
result = i; result = i;
......
...@@ -1050,7 +1050,7 @@ _eofout: ...@@ -1050,7 +1050,7 @@ _eofout:
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
int VORBIS_specialIndexOf(uint8_t* base, const char* str, int baselen, bool exact){ int VORBIS_specialIndexOf(uint8_t* base, const char* str, int baselen, bool exact){
int result = 0; // seek for str in buffer or in header up to baselen, not nullterninated int result = -1; // seek for str in buffer or in header up to baselen, not nullterninated
if (strlen(str) > baselen) return -1; // if exact == true seekstr in buffer must have "\0" at the end if (strlen(str) > baselen) return -1; // if exact == true seekstr in buffer must have "\0" at the end
for (int i = 0; i < baselen - strlen(str); i++){ for (int i = 0; i < baselen - strlen(str); i++){
result = i; result = i;
......
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