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) {
m_expectedPlsFmt = FORMAT_NONE;
if(res) {
log_i("connecttohost(): %s", rqh);
// log_i("connecttohost(): %s", rqh);
_client->print(rqh);
if(endsWith(extension, ".mp3" )) m_expectedCodec = CODEC_MP3;
if(endsWith(extension, ".aac" )) m_expectedCodec = CODEC_AAC;
......@@ -3033,6 +3033,7 @@ void Audio::processLocalFile() {
stopSong();
return;
}
m_controlCounter = 100;
if(m_controlCounter != 100) {
if((millis() - ctime) > timeout) {
log_e("audioHeader reading timeout");
......@@ -4261,8 +4262,10 @@ int Audio::findNextSync(uint8_t* data, size_t len) {
nextSync = 0;
}
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);
nextSync = FLACFindSyncWord(data, len);
//nextSync = FLACFindSyncWord(data, len);
}
if(m_codec == CODEC_OPUS) {
nextSync = OPUSFindSyncWord(data, len);
......
......@@ -337,7 +337,7 @@ private:
}
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
for (int i = 0; i < baselen - strlen(str); i++){
result = i;
......
This diff is collapsed.
......@@ -150,6 +150,7 @@ boolean FLACFindMagicWord(unsigned char* buf, int nBytes);
char* FLACgetStreamTitle();
int FLACparseOGG(uint8_t *inbuf, int *bytesLeft);
bool FLACDecoder_AllocateBuffers(void);
void FLACDecoder_setDefaults();
void FLACDecoder_ClearBuffer();
void FLACDecoder_FreeBuffers();
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){
}
//----------------------------------------------------------------------------------------------------------------------
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
for (int i = 0; i < baselen - strlen(str); i++){
result = i;
......
......@@ -1050,7 +1050,7 @@ _eofout:
//----------------------------------------------------------------------------------------------------------------------
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
for (int i = 0; i < baselen - strlen(str); 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