Skip to content

Commit

Permalink
Description: no sf2 sound fonts loaded by default Introduced in 1.2.1…
Browse files Browse the repository at this point in the history
…2-6 (Thu, 11 Jul 2013 12:17:15 +0100)

Author: Fabian Greffrath <fabian@greffrath.com>
Last-Update: 2014-10-24
Bug-Debian: http://bugs.debian.org/715461
  • Loading branch information
slouken committed Oct 13, 2017
1 parent bd239ae commit 1320a49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mixer.c
Expand Up @@ -151,6 +151,11 @@ int Mix_Init(int flags)
{
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) {
Expand Down
11 changes: 8 additions & 3 deletions music.c
Expand Up @@ -1633,6 +1633,7 @@ int Mix_EachSoundFont(int (*function)(const char*, void*), void *data)
{
char *context, *path, *paths;
const char* cpaths = Mix_GetSoundFonts();
int soundfonts_found = 0;

if (!cpaths) {
Mix_SetError("No SoundFonts have been requested");
Expand All @@ -1652,12 +1653,16 @@ int Mix_EachSoundFont(int (*function)(const char*, void*), void *data)
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

0 comments on commit 1320a49

Please sign in to comment.