Package list libsdl2-mixer / e5fb0b4
Update and refresh the patch (whitespace changes) Manuel A. Fernandez Montecelo 7 years ago
1 changed file(s) with 29 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
00 Description: no sf2 sound fonts loaded by default
11 Introduced in 1.2.12-6 (Thu, 11 Jul 2013 12:17:15 +0100)
22 Author: Fabian Greffrath <fabian@greffrath.com>
3 Last-Update: 2013-10-09
3 Last-Update: 2014-10-24
44 Bug-Debian: http://bugs.debian.org/715461
55 --- a/mixer.c
66 +++ b/mixer.c
7 @@ -148,6 +148,11 @@
7 @@ -149,6 +149,11 @@
88 {
9 int result = 0;
9 int result = 0;
1010
1111 +#ifdef MIX_INIT_SOUNDFONT_PATHS
12 + if (!soundfont_paths)
13 + soundfont_paths = SDL_strdup(MIX_INIT_SOUNDFONT_PATHS);
12 + if (!soundfont_paths)
13 + soundfont_paths = SDL_strdup(MIX_INIT_SOUNDFONT_PATHS);
1414 +#endif
1515 +
16 if (flags & MIX_INIT_FLUIDSYNTH) {
16 if (flags & MIX_INIT_FLUIDSYNTH) {
1717 #ifdef USE_FLUIDSYNTH_MIDI
18 if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
18 if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
1919 --- a/music.c
2020 +++ b/music.c
21 @@ -1567,6 +1567,7 @@
21 @@ -1579,6 +1579,7 @@
2222 {
23 char *context, *path, *paths;
24 const char* cpaths = Mix_GetSoundFonts();
25 + int soundfonts_found = 0;
23 char *context, *path, *paths;
24 const char* cpaths = Mix_GetSoundFonts();
25 + int soundfonts_found = 0;
2626
27 if (!cpaths) {
28 Mix_SetError("No SoundFonts have been requested");
29 @@ -1586,12 +1587,16 @@
30 for (path = strtok_r(paths, ":;", &context); path; path = strtok_r(NULL, ":;", &context)) {
27 if (!cpaths) {
28 Mix_SetError("No SoundFonts have been requested");
29 @@ -1598,12 +1599,16 @@
30 for (path = strtok_r(paths, ":;", &context); path; path = strtok_r(NULL, ":;", &context)) {
3131 #endif
32 if (!function(path, data)) {
33 - SDL_free(paths);
34 - return 0;
35 + continue;
36 + } else {
37 + soundfonts_found++;
38 }
39 }
32 if (!function(path, data)) {
33 - SDL_free(paths);
34 - return 0;
35 + continue;
36 + } else {
37 + soundfonts_found++;
38 }
39 }
4040
41 SDL_free(paths);
42 - return 1;
43 + if (soundfonts_found > 0)
44 + return 1;
45 + else
46 + return 0;
41 SDL_free(paths);
42 - return 1;
43 + if (soundfonts_found > 0)
44 + return 1;
45 + else
46 + return 0;
4747 }
4848 #endif