Commit 0b664f72 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela

[ALSA] 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.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 394d0516
...@@ -283,6 +283,8 @@ int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c, ...@@ -283,6 +283,8 @@ int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c,
ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED; ev->flags |= SNDRV_SEQ_EVENT_LENGTH_FIXED;
if (status_event[dev->type].encode) /* set data values */ if (status_event[dev->type].encode) /* set data values */
status_event[dev->type].encode(dev, ev); status_event[dev->type].encode(dev, ev);
if (dev->type >= ST_SPECIAL)
dev->type = ST_INVALID;
rc = 1; rc = 1;
} else if (dev->type == ST_SYSEX) { } else if (dev->type == ST_SYSEX) {
if (c == MIDI_CMD_COMMON_SYSEX_END || if (c == MIDI_CMD_COMMON_SYSEX_END ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment