Package: libsdl-mixer1.2
Version: 1.2.8-1
Severity: minor
Tags: patch

Dear SDL-Developers,

sdl-mixer does not depend on timidity to play midi; at least not technically, i.e. it does not need any of the binaries provided by the timidity package. However, games do only play music if *both* the timidity and the freepats packages are installed, although sdl-mixer could play music with only the freepats package installed. The reason for this is, that sdl-mixer tries to load timidity's configuration file, which is provided in '/etc/timidity/timidity.cfg', to find out which patchset is used by timidity. By now, the only patchset available in Debian is freepats. Thus the only line in timidity.cfg (from the Debian package) that is not commented out is 'source freepats.cfg'. That file is in turn provided by the freepats package. So the only reason, why sdl-mixer might need the timidity package is to learn that it should parse the freepats configuration file instead.

Please find applied a patch that changes the default behaviour to look for the timidity.cfg file (as before) and then - if it does not succeed - try to load the freepats.cfg file (in '/etc/timidity/freepats.cfg', as provided by the Debian package). This way, sdl-mixer can make use of the patchset provided by the freepats package without even having the timidity package installed. An existing freepats.cfg will still be first choice, however.

Thank you very much!

Cheers,
Fabian

--
Dipl.-Phys. Fabian Greffrath

Ruhr-Universität Bochum
Lehrstuhl für Energieanlagen und Energieprozesstechnik (LEAT)
Universitätsstr. 150, IB 3/134
D-44780 Bochum

Telefon: +49 (0)234 / 32-26334
Fax:     +49 (0)234 / 32-14227
E-Mail:  [EMAIL PROTECTED]

diff -Naru sdl-mixer1.2-1.2.8~/timidity/config.h sdl-mixer1.2-1.2.8/timidity/config.h
--- sdl-mixer1.2-1.2.8~/timidity/config.h	2007-07-02 04:03:51.000000000 +0200
+++ sdl-mixer1.2-1.2.8/timidity/config.h	2007-11-28 07:41:40.000000000 +0100
@@ -172,6 +172,7 @@
 #define CONFIG_FILE	"timidity.cfg"
 #define CONFIG_FILE_ETC "/etc/timidity.cfg"
 #define CONFIG_FILE_ETC_TIMIDITY "/etc/timidity/timidity.cfg"
+#define CONFIG_FILE_ETC_TIMIDITY_FREEPATS "/etc/timidity/freepats.cfg"
 
 #if defined(__WIN32__) || defined(__OS2__)
 #define DEFAULT_PATH	"\\TIMIDITY"
diff -Naru sdl-mixer1.2-1.2.8~/timidity/timidity.c sdl-mixer1.2-1.2.8/timidity/timidity.c
--- sdl-mixer1.2-1.2.8~/timidity/timidity.c	2007-07-02 04:03:52.000000000 +0200
+++ sdl-mixer1.2-1.2.8/timidity/timidity.c	2007-11-28 07:42:01.000000000 +0100
@@ -297,7 +297,9 @@
   if (read_config_file(CONFIG_FILE)<0) {
     if (read_config_file(CONFIG_FILE_ETC)<0) {
       if (read_config_file(CONFIG_FILE_ETC_TIMIDITY)<0) {
-        return(-1);
+        if (read_config_file(CONFIG_FILE_ETC_TIMIDITY_FREEPATS)<0) {
+          return(-1);
+        }
       }
     }
   }

Reply via email to