33 *
44 * Created on: Oct 26.2018
55 *
6- * Version 2.0.4c
7- * Updated on: Jul 09 .2022
6+ * Version 2.0.4d
7+ * Updated on: Jul 11 .2022
88 * Author: Wolle (schreibfaul1)
99 *
1010 */
@@ -1346,7 +1346,7 @@ int Audio::read_FLAC_Header(uint8_t *data, size_t len) {
13461346 return 0 ;
13471347}
13481348// ---------------------------------------------------------------------------------------------------------------------
1349- int Audio::read_MP3_Header (uint8_t *data, size_t len) {
1349+ int Audio::read_ID3_Header (uint8_t *data, size_t len) {
13501350
13511351 static size_t id3Size;
13521352 static size_t headerSize;
@@ -2661,7 +2661,7 @@ void Audio::processLocalFile() {
26612661 }
26622662 }
26632663 if (m_codec == CODEC_MP3){
2664- int res = read_MP3_Header (InBuff.getReadPtr (), bytesCanBeRead);
2664+ int res = read_ID3_Header (InBuff.getReadPtr (), bytesCanBeRead);
26652665 if (res >= 0 ) bytesDecoded = res;
26662666 else { // error, skip header
26672667 m_controlCounter = 100 ;
@@ -2957,15 +2957,15 @@ void Audio::processWebStream() {
29572957 }
29582958
29592959 // if we have a webfile, read the file header first - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2960- if (m_f_webfile && m_controlCounter != 100 && m_playlistFormat != FORMAT_M3U8 ){ // m3u8call, audiochunk has no header
2960+ if (m_f_webfile && m_controlCounter != 100 ){ // m3u8call, audiochunk has no header
29612961 if (InBuff.bufferFilled () < maxFrameSize) return ;
29622962 if (m_codec == CODEC_WAV){
29632963 int res = read_WAV_Header (InBuff.getReadPtr (), InBuff.bufferFilled ());
29642964 if (res >= 0 ) bytesDecoded = res;
29652965 else {stopSong (); return ;}
29662966 }
29672967 if (m_codec == CODEC_MP3){
2968- int res = read_MP3_Header (InBuff.getReadPtr (), InBuff.bufferFilled ());
2968+ int res = read_ID3_Header (InBuff.getReadPtr (), InBuff.bufferFilled ());
29692969 if (res >= 0 ) bytesDecoded = res;
29702970 else {m_controlCounter = 100 ;} // error, skip header
29712971 }
@@ -2977,11 +2977,17 @@ void Audio::processWebStream() {
29772977 if (m_codec == CODEC_FLAC){
29782978 int res = read_FLAC_Header (InBuff.getReadPtr (), InBuff.bufferFilled ());
29792979 if (res >= 0 ) bytesDecoded = res;
2980- else {stopSong (); return ;} // error, skip header
2980+ else {stopSong (); return ;} // error, skip header
29812981 }
2982- if (m_codec == CODEC_AAC){ // aac has no header
2983- m_controlCounter = 100 ;
2984- return ;
2982+ if (m_codec == CODEC_AAC){ // aac has no header
2983+ if (m_playlistFormat == FORMAT_M3U8){ // except m3u8 stream
2984+ int res = read_ID3_Header (InBuff.getReadPtr (), InBuff.bufferFilled ());
2985+ if (res >= 0 ) bytesDecoded = res;
2986+ else m_controlCounter = 100 ;
2987+ }
2988+ else {
2989+ m_controlCounter = 100 ;
2990+ }
29852991 }
29862992 InBuff.bytesWasRead (bytesDecoded);
29872993 return ;
@@ -3387,7 +3393,7 @@ bool Audio::parseContentType(char* ct) {
33873393
33883394 if (!strcmp (ct, " audio/aac" )) ct_val = CT_AAC;
33893395 if (!strcmp (ct, " audio/x-aac" )) ct_val = CT_AAC;
3390- if (!strcmp (ct, " audio/aacp" )) ct_val = CT_AACP ;
3396+ if (!strcmp (ct, " audio/aacp" )) ct_val = CT_AAC ;
33913397 if (!strcmp (ct, " audio/mp4" )) ct_val = CT_M4A;
33923398 if (!strcmp (ct, " audio/m4a" )) ct_val = CT_M4A;
33933399
@@ -3411,7 +3417,7 @@ bool Audio::parseContentType(char* ct) {
34113417 if (!strcmp (ct, " text/html" )) ct_val = CT_TXT;
34123418 if (!strcmp (ct, " text/plain" )) ct_val = CT_TXT;
34133419
3414- if (ct_val == CT_NONE || ct_val == CT_AACP ){
3420+ if (ct_val == CT_NONE){
34153421 AUDIO_INFO (" ContentType %s not supported" , ct);
34163422 return false ; // nothing valid had been seen
34173423 }
0 commit comments