Description: no sf2 sound fonts loaded by default Introduced in 1.2.12-6 (Thu, 11 Jul 2013 12:17:15 +0100)
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Oct 2017 23:05:15 -0700
changeset 7626c6adcc85536
parent 761 2c0a45f9a767
child 763 52007e252a1c
Description: no sf2 sound fonts loaded by default Introduced in 1.2.12-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
mixer.c
music.c
     1.1 --- a/mixer.c	Thu Oct 12 22:57:17 2017 -0700
     1.2 +++ b/mixer.c	Thu Oct 12 23:05:15 2017 -0700
     1.3 @@ -151,6 +151,11 @@
     1.4  {
     1.5      int result = 0;
     1.6  
     1.7 +#ifdef MIX_INIT_SOUNDFONT_PATHS
     1.8 +    if (!soundfont_paths)
     1.9 +        soundfont_paths = SDL_strdup(MIX_INIT_SOUNDFONT_PATHS);
    1.10 +#endif
    1.11 +
    1.12      if (flags & MIX_INIT_FLUIDSYNTH) {
    1.13  #ifdef USE_FLUIDSYNTH_MIDI
    1.14          if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
     2.1 --- a/music.c	Thu Oct 12 22:57:17 2017 -0700
     2.2 +++ b/music.c	Thu Oct 12 23:05:15 2017 -0700
     2.3 @@ -1633,6 +1633,7 @@
     2.4  {
     2.5      char *context, *path, *paths;
     2.6      const char* cpaths = Mix_GetSoundFonts();
     2.7 +    int soundfonts_found = 0;
     2.8  
     2.9      if (!cpaths) {
    2.10          Mix_SetError("No SoundFonts have been requested");
    2.11 @@ -1652,12 +1653,16 @@
    2.12      for (path = strtok_r(paths, ":;", &context); path; path = strtok_r(NULL, ":;", &context)) {
    2.13  #endif
    2.14          if (!function(path, data)) {
    2.15 -            SDL_free(paths);
    2.16 -            return 0;
    2.17 +            continue;
    2.18 +        } else {
    2.19 +            soundfonts_found++;
    2.20          }
    2.21      }
    2.22  
    2.23      SDL_free(paths);
    2.24 -    return 1;
    2.25 +    if (soundfonts_found > 0)
    2.26 +        return 1;
    2.27 +    else
    2.28 +        return 0;
    2.29  }
    2.30  #endif