[AD] small alsamidi fix

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Just discovered a small bug in the alsamidi code. The return value of
snd_rawmidi_write is undocumented in the alsa docs.. and apparently, it
is not an error value as the code assumed - at least I can hear the midi
being played by timidity despite the error messages the current code
gave.

-- 
Elias Pschernig
Index: src/unix/alsamidi.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/unix/alsamidi.c,v
retrieving revision 1.21
diff -u -p -r1.21 alsamidi.c
--- src/unix/alsamidi.c	24 Sep 2004 14:45:03 -0000	1.21
+++ src/unix/alsamidi.c	18 Mar 2005 13:15:48 -0000
@@ -223,14 +223,7 @@ static void alsa_rawmidi_exit(int input)
  */
 static void alsa_rawmidi_output(int data)
 {
-   int err;
-   char temp[256];
-
-   err = snd_rawmidi_write(rawmidi_handle, &data, sizeof(char));
-   if (err) {
-      snprintf(temp, sizeof(temp), "Could not write to rawmidi port: %s", snd_strerror(err));
-      ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text(temp));
-   }
+   snd_rawmidi_write(rawmidi_handle, &data, sizeof(char));
 }
 
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/