*** empty log message ***
authorSam Lantinga <slouken@libsdl.org>
Fri, 30 Nov 2001 16:51:15 +0000
changeset 135b9cc87fba5ac
parent 134 2d3417d1860a
child 136 1a97c13243e0
*** empty log message ***
music.c
wavestream.c
     1.1 --- a/music.c	Fri Nov 30 16:48:33 2001 +0000
     1.2 +++ b/music.c	Fri Nov 30 16:51:15 2001 +0000
     1.3 @@ -434,20 +434,21 @@
     1.4  	/* WAVE files have the magic four bytes "RIFF"
     1.5  	   AIFF files have the magic 12 bytes "FORM" XXXX "AIFF"
     1.6  	 */
     1.7 -	if ( (ext && (MIX_string_equals(ext, "WAV") == 0)) ||
     1.8 +	if ( (ext && MIX_string_equals(ext, "WAV")) ||
     1.9  	     (strcmp((char *)magic, "RIFF") == 0) ||
    1.10  	     (strcmp((char *)magic, "FORM") == 0) ) {
    1.11  		music->type = MUS_WAV;
    1.12  		music->data.wave = WAVStream_LoadSong(file, (char *)magic);
    1.13  		if ( music->data.wave == NULL ) {
    1.14 +		  	Mix_SetError("Unable to load WAV file");
    1.15  			music->error = 1;
    1.16  		}
    1.17  	} else
    1.18  #endif
    1.19  #ifdef MID_MUSIC
    1.20  	/* MIDI files have the magic four bytes "MThd" */
    1.21 -	if ( (ext && (MIX_string_equals(ext, "MID") == 0)) ||
    1.22 -	     (ext && (MIX_string_equals(ext, "MIDI") == 0)) ||
    1.23 +	if ( (ext && MIX_string_equals(ext, "MID")) ||
    1.24 +	     (ext && MIX_string_equals(ext, "MIDI")) ||
    1.25  	     strcmp((char *)magic, "MThd") == 0 ) {
    1.26  		music->type = MUS_MID;
    1.27  #ifdef USE_NATIVE_MIDI
    1.28 @@ -475,7 +476,7 @@
    1.29  #endif
    1.30  #ifdef OGG_MUSIC
    1.31  	/* Ogg Vorbis files have the magic four bytes "OggS" */
    1.32 -	if ( (ext && (MIX_string_equals(ext, "OGG") == 0)) ||
    1.33 +	if ( (ext && MIX_string_equals(ext, "OGG")) ||
    1.34  	     strcmp((char *)magic, "OggS") == 0 ) {
    1.35  		music->type = MUS_OGG;
    1.36  		music->data.ogg = OGG_new(file);
    1.37 @@ -485,8 +486,8 @@
    1.38  	} else
    1.39  #endif
    1.40  #ifdef MP3_MUSIC
    1.41 -	if ( (ext && (MIX_string_equals(ext, "MPG") == 0)) ||
    1.42 -	     (ext && (MIX_string_equals(ext, "MPEG") == 0)) ||
    1.43 +	if ( (ext && MIX_string_equals(ext, "MPG")) ||
    1.44 +	     (ext && MIX_string_equals(ext, "MPEG")) ||
    1.45  	     magic[0]==0xFF && (magic[1]&0xF0)==0xF0) {
    1.46  		SMPEG_Info info;
    1.47  		music->type = MUS_MP3;
     2.1 --- a/wavestream.c	Fri Nov 30 16:48:33 2001 +0000
     2.2 +++ b/wavestream.c	Fri Nov 30 16:51:15 2001 +0000
     2.3 @@ -32,6 +32,7 @@
     2.4  #include "SDL_rwops.h"
     2.5  #include "SDL_endian.h"
     2.6  
     2.7 +#include "SDL_mixer.h"
     2.8  #include "wavestream.h"
     2.9  
    2.10  /*
    2.11 @@ -142,6 +143,8 @@
    2.12  		if ( strcmp(magic, "FORM") == 0 ) {
    2.13  			wave->wavefp = LoadAIFFStream(file, &wavespec,
    2.14  					&wave->start, &wave->stop);
    2.15 +		} else {
    2.16 +			Mix_SetError("Unknown WAVE format");
    2.17  		}
    2.18  		if ( wave->wavefp == NULL ) {
    2.19  			free(wave);