mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
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.
This commit is contained in:
parent
2c281e1648
commit
4ebeecda28
1 changed files with 2 additions and 0 deletions
|
|
@ -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 ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue