music.c
changeset 133 2f15d225fe94
parent 129 782927d8df26
child 135 b9cc87fba5ac
equal deleted inserted replaced
132:5707e5165d84 133:2f15d225fe94
   446 #endif
   446 #endif
   447 #ifdef MID_MUSIC
   447 #ifdef MID_MUSIC
   448 	/* MIDI files have the magic four bytes "MThd" */
   448 	/* MIDI files have the magic four bytes "MThd" */
   449 	if ( (ext && (MIX_string_equals(ext, "MID") == 0)) ||
   449 	if ( (ext && (MIX_string_equals(ext, "MID") == 0)) ||
   450 	     (ext && (MIX_string_equals(ext, "MIDI") == 0)) ||
   450 	     (ext && (MIX_string_equals(ext, "MIDI") == 0)) ||
   451 	     strcmp(magic, "MThd") == 0 ) {
   451 	     strcmp((char *)magic, "MThd") == 0 ) {
   452 		music->type = MUS_MID;
   452 		music->type = MUS_MID;
   453 #ifdef USE_NATIVE_MIDI
   453 #ifdef USE_NATIVE_MIDI
   454   		if ( native_midi_ok ) {
   454   		if ( native_midi_ok ) {
   455   			music->data.nativemidi = native_midi_loadsong((char *)file);
   455   			music->data.nativemidi = native_midi_loadsong((char *)file);
   456 	  		if ( music->data.nativemidi == NULL ) {
   456 	  		if ( music->data.nativemidi == NULL ) {
   474 	} else
   474 	} else
   475 #endif
   475 #endif
   476 #ifdef OGG_MUSIC
   476 #ifdef OGG_MUSIC
   477 	/* Ogg Vorbis files have the magic four bytes "OggS" */
   477 	/* Ogg Vorbis files have the magic four bytes "OggS" */
   478 	if ( (ext && (MIX_string_equals(ext, "OGG") == 0)) ||
   478 	if ( (ext && (MIX_string_equals(ext, "OGG") == 0)) ||
   479 	     strcmp(magic, "OggS") == 0 ) {
   479 	     strcmp((char *)magic, "OggS") == 0 ) {
   480 		music->type = MUS_OGG;
   480 		music->type = MUS_OGG;
   481 		music->data.ogg = OGG_new(file);
   481 		music->data.ogg = OGG_new(file);
   482 		if ( music->data.ogg == NULL ) {
   482 		if ( music->data.ogg == NULL ) {
   483 			music->error = 1;
   483 			music->error = 1;
   484 		}
   484 		}