File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ class MultiDecoder : public AudioDecoder {
6565 // find the corresponding decoder
6666 for (int j = 0 ; j < decoders.size (); j++) {
6767 DecoderInfo info = decoders[j];
68- if (StrView (info.mime ).equalsIgnoreCase (mime)) {
69- LOGI (" New decoder found for %s" , info.mime );
68+ if (StrView (info.mime ).equals (mime)) {
69+ LOGI (" New decoder found for %s (%s) " , info.mime , mime);
7070 actual_decoder = info;
7171 // define output if it has not been defined
7272 if (p_print!=nullptr
Original file line number Diff line number Diff line change @@ -64,15 +64,18 @@ class MimeDetector {
6464 const uint8_t * start = (const uint8_t *)data;
6565 if (start[0 ] == 0xFF && start[1 ] == 0xF1 ) {
6666 mime = " audio/aac" ;
67- } else if (memcmp (start, " ID3" , 3 ) || start[0 ] == 0xFF ||
68- start[0 ] == 0xFE ) {
69- mime = " audio/mpeg" ;
70- } else if (memcmp (start, " RIFF" , 4 )) {
67+ } else if (memcmp (start, " RIFF" , 4 )==0 ) {
7168 mime = " audio/vnd.wave" ;
72- } else if (memcmp (start, " OggS" , 4 )) {
69+ } else if (memcmp (start, " OggS" , 4 )== 0 ) {
7370 mime = " audio/ogg" ;
71+ } else if (memcmp (start, " ID3" , 3 )==0 || start[0 ] == 0xFF ||
72+ start[0 ] == 0xFE ) {
73+ mime = " audio/mpeg" ;
7474 }
7575 }
76+ if (mime != nullptr ) {
77+ LOGI (" Determined mime: %s" , mime);
78+ }
7679 return mime;
7780 }
7881};
You can’t perform that action at this time.
0 commit comments