diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-06-22 04:01:59 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-22 05:11:49 -0400 |
commit | 6423f9ea8035138d70bae1a278d3b57b743f8b3e (patch) | |
tree | ea367c24fdcac966da4f51b1cc678f995f19dcff /sound/core | |
parent | 07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff) |
sound: seq_midi_event: fix decoding of (N)RPN events
When decoding (N)RPN sequencer events into raw MIDI commands, the
extra_decode_xrpn() function had accidentally swapped the MSB and LSB
controller values of both the parameter number and the data value.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/seq/seq_midi_event.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c index 8284f176a342..b5d6ea4904c0 100644 --- a/sound/core/seq/seq_midi_event.c +++ b/sound/core/seq/seq_midi_event.c | |||
@@ -504,10 +504,10 @@ static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf, | |||
504 | if (dev->nostat && count < 12) | 504 | if (dev->nostat && count < 12) |
505 | return -ENOMEM; | 505 | return -ENOMEM; |
506 | cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); | 506 | cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); |
507 | bytes[0] = ev->data.control.param & 0x007f; | 507 | bytes[0] = (ev->data.control.param & 0x3f80) >> 7; |
508 | bytes[1] = (ev->data.control.param & 0x3f80) >> 7; | 508 | bytes[1] = ev->data.control.param & 0x007f; |
509 | bytes[2] = ev->data.control.value & 0x007f; | 509 | bytes[2] = (ev->data.control.value & 0x3f80) >> 7; |
510 | bytes[3] = (ev->data.control.value & 0x3f80) >> 7; | 510 | bytes[3] = ev->data.control.value & 0x007f; |
511 | if (cmd != dev->lastcmd && !dev->nostat) { | 511 | if (cmd != dev->lastcmd && !dev->nostat) { |
512 | if (count < 9) | 512 | if (count < 9) |
513 | return -ENOMEM; | 513 | return -ENOMEM; |