Use Mix_SetError() instead of SDL_SetError()
authorSam Lantinga <slouken@libsdl.org>
Fri, 30 Nov 2001 16:48:33 +0000
changeset 1342d3417d1860a
parent 133 2f15d225fe94
child 135 b9cc87fba5ac
Use Mix_SetError() instead of SDL_SetError()
wavestream.c
     1.1 --- a/wavestream.c	Fri Nov 30 16:33:05 2001 +0000
     1.2 +++ b/wavestream.c	Fri Nov 30 16:48:33 2001 +0000
     1.3 @@ -129,7 +129,7 @@
     1.4  	SDL_AudioSpec wavespec;
     1.5  
     1.6  	if ( ! mixer.format ) {
     1.7 -		SDL_SetError("WAV music output not started");
     1.8 +		Mix_SetError("WAV music output not started");
     1.9  		return(NULL);
    1.10  	}
    1.11  	wave = (WAVStream *)malloc(sizeof *wave);
    1.12 @@ -268,11 +268,11 @@
    1.13  	if ( read_data ) {
    1.14  		chunk->data = (Uint8 *)malloc(chunk->length);
    1.15  		if ( chunk->data == NULL ) {
    1.16 -			SDL_SetError("Out of memory");
    1.17 +			Mix_SetError("Out of memory");
    1.18  			return(-1);
    1.19  		}
    1.20  		if ( SDL_RWread(src, chunk->data, chunk->length, 1) != 1 ) {
    1.21 -			SDL_SetError("Couldn't read chunk");
    1.22 +			Mix_SetError("Couldn't read chunk");
    1.23  			free(chunk->data);
    1.24  			return(-1);
    1.25  		}
    1.26 @@ -316,7 +316,7 @@
    1.27  	wavelen		= SDL_ReadLE32(src);
    1.28  	WAVEmagic	= SDL_ReadLE32(src);
    1.29  	if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) {
    1.30 -		SDL_SetError("Unrecognized file type (not WAVE)");
    1.31 +		Mix_SetError("Unrecognized file type (not WAVE)");
    1.32  		was_error = 1;
    1.33  		goto done;
    1.34  	}
    1.35 @@ -339,7 +339,7 @@
    1.36  	format = (WaveFMT *)chunk.data;
    1.37  	if ( chunk.magic != FMT ) {
    1.38  		free(chunk.data);
    1.39 -		SDL_SetError("Complex WAVE files not supported");
    1.40 +		Mix_SetError("Complex WAVE files not supported");
    1.41  		was_error = 1;
    1.42  		goto done;
    1.43  	}
    1.44 @@ -348,7 +348,7 @@
    1.45  			/* We can understand this */
    1.46  			break;
    1.47  		default:
    1.48 -			SDL_SetError("Unknown WAVE data format");
    1.49 +			Mix_SetError("Unknown WAVE data format");
    1.50  			was_error = 1;
    1.51  			goto done;
    1.52  	}
    1.53 @@ -362,7 +362,7 @@
    1.54  			spec->format = AUDIO_S16;
    1.55  			break;
    1.56  		default:
    1.57 -			SDL_SetError("Unknown PCM data format");
    1.58 +			Mix_SetError("Unknown PCM data format");
    1.59  			was_error = 1;
    1.60  			goto done;
    1.61  	}
    1.62 @@ -467,7 +467,7 @@
    1.63  	chunk_length	= SDL_ReadBE32(src);
    1.64  	AIFFmagic	= SDL_ReadLE32(src);
    1.65  	if ( (FORMchunk != FORM) || (AIFFmagic != AIFF) ) {
    1.66 -		SDL_SetError("Unrecognized file type (not AIFF)");
    1.67 +		Mix_SetError("Unrecognized file type (not AIFF)");
    1.68  		was_error = 1;
    1.69  		goto done;
    1.70  	}
    1.71 @@ -517,13 +517,13 @@
    1.72  		 && SDL_RWseek(src, next_chunk, SEEK_SET) != -1);
    1.73  
    1.74  	if (!found_SSND) {
    1.75 -	    SDL_SetError("Bad AIFF file (no SSND chunk)");
    1.76 +	    Mix_SetError("Bad AIFF file (no SSND chunk)");
    1.77  	    was_error = 1;
    1.78  	    goto done;
    1.79  	}
    1.80  		    
    1.81  	if (!found_COMM) {
    1.82 -	    SDL_SetError("Bad AIFF file (no COMM chunk)");
    1.83 +	    Mix_SetError("Bad AIFF file (no COMM chunk)");
    1.84  	    was_error = 1;
    1.85  	    goto done;
    1.86  	}
    1.87 @@ -541,7 +541,7 @@
    1.88  			spec->format = AUDIO_S16MSB;
    1.89  			break;
    1.90  		default:
    1.91 -			SDL_SetError("Unknown samplesize in data format");
    1.92 +			Mix_SetError("Unknown samplesize in data format");
    1.93  			was_error = 1;
    1.94  			goto done;
    1.95  	}