music.c
changeset 256 6d7e102500c9
parent 254 1ad5ff083036
child 260 87f2a3d6e4e5
     1.1 --- a/music.c	Tue Dec 21 17:52:16 2004 +0000
     1.2 +++ b/music.c	Tue Dec 21 20:08:57 2004 +0000
     1.3 @@ -560,14 +560,14 @@
     1.4  	if ( (ext && MIX_string_equals(ext, "MPG")) ||
     1.5  	     (ext && MIX_string_equals(ext, "MP3")) ||
     1.6  	     (ext && MIX_string_equals(ext, "MPEG")) ||
     1.7 -	     magic[0]==0xFF && (magic[1]&0xF0)==0xF0) {
     1.8 +	     (magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0) ) {
     1.9  		SMPEG_Info info;
    1.10  		music->type = MUS_MP3;
    1.11  		music->data.mp3 = SMPEG_new(file, &info, 0);
    1.12 -		if(!info.has_audio){
    1.13 +		if ( !info.has_audio ) {
    1.14  			Mix_SetError("MPEG file does not have any audio stream.");
    1.15  			music->error = 1;
    1.16 -		}else{
    1.17 +		} else {
    1.18  			SMPEG_actualSpec(music->data.mp3, &used_mixer);
    1.19  		}
    1.20  	} else
    1.21 @@ -1330,6 +1330,19 @@
    1.22  		}
    1.23  	} else
    1.24  #endif
    1.25 +#ifdef MP3_MUSIC
    1.26 +	if ( magic[0] == 0xFF && (magic[1] & 0xF0) == 0xF0 ) {
    1.27 +		SMPEG_Info info;
    1.28 +		music->type = MUS_MP3;
    1.29 +		music->data.mp3 = SMPEG_new_rwops(rw, &info, 0);
    1.30 +		if ( !info.has_audio ) {
    1.31 +			Mix_SetError("MPEG file does not have any audio stream.");
    1.32 +			music->error = 1;
    1.33 +		} else {
    1.34 +			SMPEG_actualSpec(music->data.mp3, &used_mixer);
    1.35 +		}
    1.36 +	} else
    1.37 +#endif
    1.38  #if defined(MOD_MUSIC) || defined(LIBMIKMOD_MUSIC)
    1.39  	if (1) {
    1.40  		music->type=MUS_MOD;