diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-08-17 12:29:11 +0200 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2009-08-17 12:29:11 +0200 |
commit | d94ab95c0df7389f586c1550c4532a54b21c34f6 (patch) | |
tree | 063730f7c83bbe692ef121376350ac4e63d10914 /seq | |
parent | 077467a87e0a5ab598a8e4a582268eebe78ff9d6 (diff) | |
download | alsa-utils-d94ab95c0df7389f586c1550c4532a54b21c34f6.tar.gz |
aplaymidi: reduce bandwidth for big SysEx messages
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>
Diffstat (limited to 'seq')
-rw-r--r-- | seq/aplaymidi/aplaymidi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/seq/aplaymidi/aplaymidi.c b/seq/aplaymidi/aplaymidi.c index 5ed7bab..ad508b3 100644 --- a/seq/aplaymidi/aplaymidi.c +++ b/seq/aplaymidi/aplaymidi.c @@ -31,7 +31,12 @@ #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. |