1.1 --- a/CHANGES Sat Sep 26 09:19:14 2009 +0000
1.2 +++ b/CHANGES Sat Sep 26 09:21:38 2009 +0000
1.3 @@ -1,4 +1,6 @@
1.4 1.2.9:
1.5 +Forrest Voight - 2009-06-13 20:31:38 PDT
1.6 + * ID3 files are now recognized as MP3 format
1.7 Austen Dicken - Tue Feb 26 23:28:27 PST 2008
1.8 * Added support for FLAC audio both as chunks and streaming
1.9 Tilman Sauerbeck - Tue Feb 26 03:44:47 PST 2008
2.1 --- a/music.c Sat Sep 26 09:19:14 2009 +0000
2.2 +++ b/music.c Sat Sep 26 09:21:38 2009 +0000
2.3 @@ -674,7 +674,8 @@
2.4 if ( (ext && MIX_string_equals(ext, "MPG")) ||
2.5 (ext && MIX_string_equals(ext, "MP3")) ||
2.6 (ext && MIX_string_equals(ext, "MPEG")) ||
2.7 - (magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ) {
2.8 + (magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ||
2.9 + (strncmp((char *)magic, "ID3", 3) == 0) ) {
2.10 if ( Mix_InitMP3() == 0 ) {
2.11 SMPEG_Info info;
2.12 music->type = MUS_MP3;
2.13 @@ -695,7 +696,8 @@
2.14 (ext && MIX_string_equals(ext, "MP3")) ||
2.15 (ext && MIX_string_equals(ext, "MPEG")) ||
2.16 (ext && MIX_string_equals(ext, "MAD")) ||
2.17 - (magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ) {
2.18 + (magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ||
2.19 + (strncmp((char *)magic, "ID3", 3) == 0) ) {
2.20 music->type = MUS_MP3_MAD;
2.21 music->data.mp3_mad = mad_openFile(file, &used_mixer);
2.22 if (music->data.mp3_mad == 0) {
2.23 @@ -1590,7 +1592,7 @@
2.24 } else
2.25 #endif
2.26 #ifdef MP3_MUSIC
2.27 - if ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0 ) {
2.28 + if ( ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) || ( strncmp((char *)magic, "ID3", 3) == 0 ) ) {
2.29 if ( Mix_InitMP3() == 0 ) {
2.30 SMPEG_Info info;
2.31 music->type = MUS_MP3;
2.32 @@ -1607,7 +1609,7 @@
2.33 } else
2.34 #endif
2.35 #ifdef MP3_MAD_MUSIC
2.36 - if ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0 ) {
2.37 + if ( ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) || ( strncmp((char *)magic, "ID3", 3) == 0 ) ) {
2.38 music->type = MUS_MP3_MAD;
2.39 music->data.mp3_mad = mad_openFileRW(rw, &used_mixer);
2.40 if (music->data.mp3_mad == 0) {