fluidsynth.c
branchSDL-1.2
changeset 881 6bf9b92cfad9
parent 585 f2943eac3fd7
child 887 e49459791ae8
equal deleted inserted replaced
880:281ee0037d92 881:6bf9b92cfad9
   122 	SDL_RWseek(rw, offset, RW_SEEK_SET);
   122 	SDL_RWseek(rw, offset, RW_SEEK_SET);
   123 
   123 
   124 	if ((buffer = (char*) SDL_malloc(size))) {
   124 	if ((buffer = (char*) SDL_malloc(size))) {
   125 		if(SDL_RWread(rw, buffer, size, 1) == 1) {
   125 		if(SDL_RWread(rw, buffer, size, 1) == 1) {
   126 			if (fluidsynth.fluid_player_add_mem(song->player, buffer, size) == FLUID_OK) {
   126 			if (fluidsynth.fluid_player_add_mem(song->player, buffer, size) == FLUID_OK) {
       
   127 				SDL_free(buffer);
   127 				return 1;
   128 				return 1;
   128 			} else {
   129 			} else {
   129 				Mix_SetError("FluidSynth failed to load in-memory song");
   130 				Mix_SetError("FluidSynth failed to load in-memory song");
   130 			}
   131 			}
   131 		} else {
   132 		} else {