Skip to content

Commit

Permalink
Forrest Voight - 2009-06-13 20:31:38 PDT
Browse files Browse the repository at this point in the history
 * ID3 files are now recognized as MP3 format
  • Loading branch information
slouken committed Sep 26, 2009
1 parent bde619e commit cffc1bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES
@@ -1,4 +1,6 @@
1.2.9:
Forrest Voight - 2009-06-13 20:31:38 PDT
* ID3 files are now recognized as MP3 format
Austen Dicken - Tue Feb 26 23:28:27 PST 2008
* Added support for FLAC audio both as chunks and streaming
Tilman Sauerbeck - Tue Feb 26 03:44:47 PST 2008
Expand Down
10 changes: 6 additions & 4 deletions music.c
Expand Up @@ -674,7 +674,8 @@ Mix_Music *Mix_LoadMUS(const char *file)
if ( (ext && MIX_string_equals(ext, "MPG")) ||
(ext && MIX_string_equals(ext, "MP3")) ||
(ext && MIX_string_equals(ext, "MPEG")) ||
(magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ) {
(magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ||
(strncmp((char *)magic, "ID3", 3) == 0) ) {
if ( Mix_InitMP3() == 0 ) {
SMPEG_Info info;
music->type = MUS_MP3;
Expand All @@ -695,7 +696,8 @@ Mix_Music *Mix_LoadMUS(const char *file)
(ext && MIX_string_equals(ext, "MP3")) ||
(ext && MIX_string_equals(ext, "MPEG")) ||
(ext && MIX_string_equals(ext, "MAD")) ||
(magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ) {
(magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ||
(strncmp((char *)magic, "ID3", 3) == 0) ) {
music->type = MUS_MP3_MAD;
music->data.mp3_mad = mad_openFile(file, &used_mixer);
if (music->data.mp3_mad == 0) {
Expand Down Expand Up @@ -1590,7 +1592,7 @@ Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw)
} else
#endif
#ifdef MP3_MUSIC
if ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0 ) {
if ( ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) || ( strncmp((char *)magic, "ID3", 3) == 0 ) ) {
if ( Mix_InitMP3() == 0 ) {
SMPEG_Info info;
music->type = MUS_MP3;
Expand All @@ -1607,7 +1609,7 @@ Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw)
} else
#endif
#ifdef MP3_MAD_MUSIC
if ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0 ) {
if ( ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) || ( strncmp((char *)magic, "ID3", 3) == 0 ) ) {
music->type = MUS_MP3_MAD;
music->data.mp3_mad = mad_openFileRW(rw, &used_mixer);
if (music->data.mp3_mad == 0) {
Expand Down

0 comments on commit cffc1bc

Please sign in to comment.