diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2007-08-10 09:39:24 +0200 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2007-08-10 09:39:24 +0200 |
commit | 4ebeecda287bb12a14c69d096b5ee4ba4911ec97 (patch) | |
tree | 6d538c0fda337942123d183b5153d55c945e1eee /src/seq | |
parent | 2c281e16485d650c252b8885f32deada4711f8ca (diff) |
seq_midi_event: prevent running status after system messages
Reset the event type after encoding a system message to prevent any
following data bytes from being interpreted as data for a running status
system message, which is not allowed in MIDI.
Diffstat (limited to 'src/seq')
-rw-r--r-- | src/seq/seq_midi_event.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/seq/seq_midi_event.c b/src/seq/seq_midi_event.c index 4fa914b0..def9d0e1 100644 --- a/src/seq/seq_midi_event.c +++ b/src/seq/seq_midi_event.c @@ -338,6 +338,8 @@ int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev ev->flags |= SND_SEQ_EVENT_LENGTH_FIXED; if (status_event[dev->type].encode) /* set data values */ status_event[dev->type].encode(dev, ev); + if (dev->type >= ST_SPECIAL) + dev->type = ST_INVALID; rc = 1; } else if (dev->type == ST_SYSEX) { if (c == MIDI_CMD_COMMON_SYSEX_END || |