Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 30, 2001
1 parent 3dd8f56 commit 068a191
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
13 changes: 7 additions & 6 deletions music.c
Expand Up @@ -434,20 +434,21 @@ Mix_Music *Mix_LoadMUS(const char *file)
/* WAVE files have the magic four bytes "RIFF"
AIFF files have the magic 12 bytes "FORM" XXXX "AIFF"
*/
if ( (ext && (MIX_string_equals(ext, "WAV") == 0)) ||
if ( (ext && MIX_string_equals(ext, "WAV")) ||
(strcmp((char *)magic, "RIFF") == 0) ||
(strcmp((char *)magic, "FORM") == 0) ) {
music->type = MUS_WAV;
music->data.wave = WAVStream_LoadSong(file, (char *)magic);
if ( music->data.wave == NULL ) {
Mix_SetError("Unable to load WAV file");
music->error = 1;
}
} else
#endif
#ifdef MID_MUSIC
/* MIDI files have the magic four bytes "MThd" */
if ( (ext && (MIX_string_equals(ext, "MID") == 0)) ||
(ext && (MIX_string_equals(ext, "MIDI") == 0)) ||
if ( (ext && MIX_string_equals(ext, "MID")) ||
(ext && MIX_string_equals(ext, "MIDI")) ||
strcmp((char *)magic, "MThd") == 0 ) {
music->type = MUS_MID;
#ifdef USE_NATIVE_MIDI
Expand Down Expand Up @@ -475,7 +476,7 @@ Mix_Music *Mix_LoadMUS(const char *file)
#endif
#ifdef OGG_MUSIC
/* Ogg Vorbis files have the magic four bytes "OggS" */
if ( (ext && (MIX_string_equals(ext, "OGG") == 0)) ||
if ( (ext && MIX_string_equals(ext, "OGG")) ||
strcmp((char *)magic, "OggS") == 0 ) {
music->type = MUS_OGG;
music->data.ogg = OGG_new(file);
Expand All @@ -485,8 +486,8 @@ Mix_Music *Mix_LoadMUS(const char *file)
} else
#endif
#ifdef MP3_MUSIC
if ( (ext && (MIX_string_equals(ext, "MPG") == 0)) ||
(ext && (MIX_string_equals(ext, "MPEG") == 0)) ||
if ( (ext && MIX_string_equals(ext, "MPG")) ||
(ext && MIX_string_equals(ext, "MPEG")) ||
magic[0]==0xFF && (magic[1]&0xF0)==0xF0) {
SMPEG_Info info;
music->type = MUS_MP3;
Expand Down
3 changes: 3 additions & 0 deletions wavestream.c
Expand Up @@ -32,6 +32,7 @@
#include "SDL_rwops.h"
#include "SDL_endian.h"

#include "SDL_mixer.h"
#include "wavestream.h"

/*
Expand Down Expand Up @@ -142,6 +143,8 @@ extern WAVStream *WAVStream_LoadSong(const char *file, const char *magic)
if ( strcmp(magic, "FORM") == 0 ) {
wave->wavefp = LoadAIFFStream(file, &wavespec,
&wave->start, &wave->stop);
} else {
Mix_SetError("Unknown WAVE format");
}
if ( wave->wavefp == NULL ) {
free(wave);
Expand Down

0 comments on commit 068a191

Please sign in to comment.