--- SDL_mixer-1.2.12.old/configure.in +++ SDL_mixer-1.2.12/configure.in @@ -41,7 +41,6 @@ AC_SUBST(LT_AGE) dnl Detect the canonical build and host environments -AC_CONFIG_AUX_DIRS($srcdir/build-scripts) dnl AC_CANONICAL_HOST dnl Check for tools --- SDL_mixer-1.2.12.old/dynamic_fluidsynth.c +++ SDL_mixer-1.2.12/dynamic_fluidsynth.c @@ -48,9 +48,14 @@ if ( fluidsynth.handle == NULL ) return -1; #endif +#if (FLUIDSYNTH_VERSION_MAJOR >= 2) + FLUIDSYNTH_LOADER(delete_fluid_player, void (*)(fluid_player_t*)); + FLUIDSYNTH_LOADER(delete_fluid_synth, void (*)(fluid_synth_t*)); +#else FLUIDSYNTH_LOADER(delete_fluid_player, int (*)(fluid_player_t*)); - FLUIDSYNTH_LOADER(delete_fluid_settings, void (*)(fluid_settings_t*)); FLUIDSYNTH_LOADER(delete_fluid_synth, int (*)(fluid_synth_t*)); +#endif + FLUIDSYNTH_LOADER(delete_fluid_settings, void (*)(fluid_settings_t*)); FLUIDSYNTH_LOADER(fluid_player_add, int (*)(fluid_player_t*, const char*)); FLUIDSYNTH_LOADER(fluid_player_add_mem, int (*)(fluid_player_t*, const void*, size_t)); FLUIDSYNTH_LOADER(fluid_player_get_status, int (*)(fluid_player_t*)); --- SDL_mixer-1.2.12.old/dynamic_fluidsynth.h +++ SDL_mixer-1.2.12/dynamic_fluidsynth.h @@ -30,9 +30,14 @@ int loaded; void *handle; +#if (FLUIDSYNTH_VERSION_MAJOR >= 2) + void (*delete_fluid_player)(fluid_player_t*); + void (*delete_fluid_synth)(fluid_synth_t*); +#else int (*delete_fluid_player)(fluid_player_t*); - void (*delete_fluid_settings)(fluid_settings_t*); int (*delete_fluid_synth)(fluid_synth_t*); +#endif + void (*delete_fluid_settings)(fluid_settings_t*); int (*fluid_player_add)(fluid_player_t*, const char*); int (*fluid_player_add_mem)(fluid_player_t*, const void*, size_t); int (*fluid_player_get_status)(fluid_player_t*); --- SDL_mixer-1.2.12.old/dynamic_ogg.c +++ SDL_mixer-1.2.12/dynamic_ogg.c @@ -52,7 +52,7 @@ return -1; } vorbis.ov_open_callbacks = - (int (*)(void *, OggVorbis_File *, char *, long, ov_callbacks)) + (int (*)(void *, OggVorbis_File *, const char *, long, ov_callbacks)) SDL_LoadFunction(vorbis.handle, "ov_open_callbacks"); if ( vorbis.ov_open_callbacks == NULL ) { SDL_UnloadObject(vorbis.handle); --- SDL_mixer-1.2.12.old/dynamic_ogg.h +++ SDL_mixer-1.2.12/dynamic_ogg.h @@ -31,7 +31,7 @@ void *handle; int (*ov_clear)(OggVorbis_File *vf); vorbis_info *(*ov_info)(OggVorbis_File *vf,int link); - int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks); + int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks); ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i); #ifdef OGG_USE_TREMOR long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream); --- SDL_mixer-1.2.12.old/fluidsynth.c +++ SDL_mixer-1.2.12/fluidsynth.c @@ -151,10 +151,12 @@ void fluidsynth_freesong(FluidSynthMidiSong *song) { + fluid_settings_t *settings; if (!song) return; + settings = fluidsynth.fluid_synth_get_settings(song->synth); fluidsynth.delete_fluid_player(song->player); - fluidsynth.delete_fluid_settings(fluidsynth.fluid_synth_get_settings(song->synth)); fluidsynth.delete_fluid_synth(song->synth); + fluidsynth.delete_fluid_settings(settings); SDL_free(song); } --- SDL_mixer-1.2.12.old/mixer.c +++ SDL_mixer-1.2.12/mixer.c @@ -34,6 +34,7 @@ #include "load_voc.h" #include "load_ogg.h" #include "load_flac.h" +#include "dynamic_fluidsynth.h" #include "dynamic_flac.h" #include "dynamic_mod.h" #include "dynamic_mp3.h" @@ -148,6 +149,11 @@ { int result = 0; +#ifdef MIX_INIT_SOUNDFONT_PATHS + if (!soundfont_paths) + soundfont_paths = SDL_strdup(MIX_INIT_SOUNDFONT_PATHS); +#endif + if (flags & MIX_INIT_FLUIDSYNTH) { #ifdef USE_FLUIDSYNTH_MIDI if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) { @@ -1485,4 +1491,3 @@ } /* end of mixer.c ... */ - --- SDL_mixer-1.2.12.old/music.c +++ SDL_mixer-1.2.12/music.c @@ -1567,6 +1567,7 @@ { char *context, *path, *paths; const char* cpaths = Mix_GetSoundFonts(); + int soundfonts_found = 0; if (!cpaths) { Mix_SetError("No SoundFonts have been requested"); @@ -1586,12 +1587,16 @@ for (path = strtok_r(paths, ":;", &context); path; path = strtok_r(NULL, ":;", &context)) { #endif if (!function(path, data)) { - SDL_free(paths); - return 0; + continue; + } else { + soundfonts_found++; } } SDL_free(paths); - return 1; + if (soundfonts_found > 0) + return 1; + else + return 0; } #endif --- SDL_mixer-1.2.12.old/music_cmd.c +++ SDL_mixer-1.2.12/music_cmd.c @@ -53,10 +53,8 @@ Mix_SetError("Out of memory"); return(NULL); } - strncpy(music->file, file, (sizeof music->file)-1); - music->file[(sizeof music->file)-1] = '\0'; - strncpy(music->cmd, cmd, (sizeof music->cmd)-1); - music->cmd[(sizeof music->cmd)-1] = '\0'; + music->file = strdup(file); + music->cmd = strdup(cmd); music->pid = 0; /* We're done */ @@ -155,7 +153,7 @@ /* Child process - executes here */ case 0: { - char command[PATH_MAX]; + char *command; char **argv; /* Unblock signals in case we're called from a thread */ @@ -166,11 +164,12 @@ } /* Execute the command */ - strcpy(command, music->cmd); + command = strdup(music->cmd); argv = parse_args(command, music->file); if ( argv != NULL ) { execvp(argv[0], argv); } + SDL_free(command); /* exec() failed */ perror(argv[0]); @@ -219,6 +218,8 @@ /* Close the given music stream */ void MusicCMD_FreeSong(MusicCMD *music) { + SDL_free(music->file); + SDL_free(music->cmd); SDL_free(music); } --- SDL_mixer-1.2.12.old/music_cmd.h +++ SDL_mixer-1.2.12/music_cmd.h @@ -30,8 +30,8 @@ # include #endif typedef struct { - char file[PATH_MAX]; - char cmd[PATH_MAX]; + char *file; + char *cmd; pid_t pid; } MusicCMD; --- SDL_mixer-1.2.12.old/timidity/timidity.c +++ SDL_mixer-1.2.12/timidity/timidity.c @@ -153,7 +153,7 @@ { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: line %d: syntax error\n", name, line); - return -2; + continue; } i=atoi(w[0]); if (i<0 || i>127)