]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aplaymidi: reduce bandwidth for big SysEx messages
authorClemens Ladisch <clemens@ladisch.de>
Mon, 17 Aug 2009 10:29:11 +0000 (12:29 +0200)
committerClemens Ladisch <clemens@ladisch.de>
Mon, 17 Aug 2009 10:29:11 +0000 (12:29 +0200)
When throttling the data rate for big SysEx messages, use the bandwidth
that devices use in practice instead of the theoretical maximum.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
seq/aplaymidi/aplaymidi.c

index 5ed7bab8b5fb33d4fd5d50d1ac669736213c6ad3..ad508b37eb86101c0530fcb94bdc326be45f93ba 100644 (file)
 #include "aconfig.h"
 #include "version.h"
 
-#define MIDI_BYTES_PER_SEC 3125
+/*
+ * 31.25 kbaud, one start bit, eight data bits, two stop bits.
+ * (The MIDI spec says one stop bit, but every transmitter uses two, just to be
+ * sure, so we better not exceed that to avoid overflowing the output buffer.)
+ */
+#define MIDI_BYTES_PER_SEC (31250 / (1 + 8 + 2))
 
 /*
  * A MIDI event after being parsed/loaded from the file.