music_ogg.c
changeset 545 32e5ed415a34
parent 542 3de4970b36d4
child 561 87bdb4c81c0b
     1.1 --- a/music_ogg.c	Wed Jan 04 01:09:57 2012 -0500
     1.2 +++ b/music_ogg.c	Wed Jan 04 01:41:10 2012 -0500
     1.3 @@ -72,6 +72,13 @@
     1.4  	OGG_music *music;
     1.5  	ov_callbacks callbacks;
     1.6  
     1.7 +	if ( !Mix_Init(MIX_INIT_OGG) ) {
     1.8 +		if ( freerw ) {
     1.9 +			SDL_RWclose(rw);
    1.10 +		}
    1.11 +		return(NULL);
    1.12 +	}
    1.13 +
    1.14  	SDL_memset(&callbacks, 0, sizeof(callbacks));
    1.15  	callbacks.read_func = sdl_read_func;
    1.16  	callbacks.seek_func = sdl_seek_func;
    1.17 @@ -87,12 +94,6 @@
    1.18  		OGG_setvolume(music, MIX_MAX_VOLUME);
    1.19  		music->section = -1;
    1.20  
    1.21 -		if ( !Mix_Init(MIX_INIT_OGG) ) {
    1.22 -			if ( freerw ) {
    1.23 -				SDL_RWclose(rw);
    1.24 -			}
    1.25 -			return(NULL);
    1.26 -		}
    1.27  		if ( vorbis.ov_open_callbacks(rw, &music->vf, NULL, 0, callbacks) < 0 ) {
    1.28  			free(music);
    1.29  			if ( freerw ) {