music.c
changeset 499 6ab2b1f10df9
parent 484 a77df8583d18
child 504 7a95f36a8bbf
     1.1 --- a/music.c	Sun Jan 23 21:44:54 2011 -0800
     1.2 +++ b/music.c	Sun Jan 23 21:45:08 2011 -0800
     1.3 @@ -779,6 +779,11 @@
     1.4  {
     1.5  	int retval;
     1.6  
     1.7 +	if ( ms_per_step == 0 ) {
     1.8 +		SDL_SetError("Audio device hasn't been opened");
     1.9 +		return(-1);
    1.10 +	}
    1.11 +
    1.12  	/* Don't play null pointers :-) */
    1.13  	if ( music == NULL ) {
    1.14  		Mix_SetError("music parameter was NULL");
    1.15 @@ -1059,6 +1064,11 @@
    1.16  {
    1.17  	int retval = 0;
    1.18  
    1.19 +	if ( ms_per_step == 0 ) {
    1.20 +		SDL_SetError("Audio device hasn't been opened");
    1.21 +		return 0;
    1.22 +	}
    1.23 +
    1.24  	if (ms <= 0) {  /* just halt immediately. */
    1.25  		Mix_HaltMusic();
    1.26  		return 1;
    1.27 @@ -1273,6 +1283,8 @@
    1.28  	free(music_decoders);
    1.29  	music_decoders = NULL;
    1.30  	num_decoders = 0;
    1.31 +
    1.32 +	ms_per_step = 0;
    1.33  }
    1.34  
    1.35  Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw)