music.c
changeset 269 1c015da5a712
parent 265 26629b8f3106
child 276 00ff1db6f904
     1.1 --- a/music.c	Sat Jul 09 05:55:12 2005 +0000
     1.2 +++ b/music.c	Sat Jul 09 14:39:59 2005 +0000
     1.3 @@ -1355,10 +1355,21 @@
     1.4  	/* MIDI files have the magic four bytes "MThd" */
     1.5  	if ( strcmp((char *)magic, "MThd") == 0 ) {
     1.6  		music->type = MUS_MID;
     1.7 +		music->error = 1;
     1.8 +#ifdef USE_NATIVE_MIDI
     1.9 +		if ( native_midi_ok ) {
    1.10 +			music->data.nativemidi = native_midi_loadsong_RW(rw);
    1.11 +			if ( music->data.nativemidi ) {
    1.12 +				music->error = 0;
    1.13 +			}
    1.14 +		} MIDI_ELSE
    1.15 +#endif
    1.16  #ifdef USE_TIMIDITY_MIDI
    1.17 -		music->data.midi = Timidity_LoadSong_RW(rw);
    1.18 -		if ( music->data.midi == NULL ) {
    1.19 -			music->error = 1;
    1.20 +		if ( timidity_ok ) {
    1.21 +			music->data.midi = Timidity_LoadSong_RW(rw);
    1.22 +			if ( music->data.midi ) {
    1.23 +				music->error = 0;
    1.24 +			}
    1.25  		}
    1.26  #endif
    1.27  	} else