Am Freitag, den 30.08.2013, 11:50 +0100 schrieb Manuel A. Fernandez
Montecelo: 
> Do you think that it could be modified to be less system dependent, in
> a way that it would be accepted upstream?  Perhaps passing it at
> compilation time, instead of having to patch or export at runtime?

How about the attached modified patch and also the one for debian/rules?

- Fabian

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 <fab...@greffrath.com>
Last-Update: 2013-08-11
Bug-Debian: http://bugs.debian.org/715461
--- a/mixer.c
+++ b/mixer.c
@@ -148,6 +148,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) {
--- a/music.c
+++ b/music.c
@@ -1567,6 +1567,7 @@ int Mix_EachSoundFont(int (*function)(co
 {
 	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 @@ int Mix_EachSoundFont(int (*function)(co
 	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
diff -Nru sdl-mixer1.2-1.2.12/debian/rules sdl-mixer1.2-1.2.12/debian/rules
--- sdl-mixer1.2-1.2.12/debian/rules 2013-07-11 13:33:46.000000000 +0200
+++ sdl-mixer1.2-1.2.12/debian/rules 2013-09-01 16:25:19.000000000 +0200
@@ -3,6 +3,7 @@
 #export DH_VERBOSE=1
 
 export DEB_CFLAGS_MAINT_APPEND = -pipe -Wall
+export DEB_CPPFLAGS_MAINT_APPEND = -DMIX_INIT_SOUNDFONT_PATHS="/usr/share/sounds/sf2/TimGM6mb.sf2:/usr/share/sounds/sf2/FluidR3_GM.sf2"
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-undefined -Wl,-Bsymbolic -Wl,--as-needed

Reply via email to