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>
This commit is contained in:
parent
07a2039b8e
commit
6423f9ea80
1 changed files with 4 additions and 4 deletions
|
@ -504,10 +504,10 @@ static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf,
|
||||||
if (dev->nostat && count < 12)
|
if (dev->nostat && count < 12)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f);
|
cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f);
|
||||||
bytes[0] = ev->data.control.param & 0x007f;
|
bytes[0] = (ev->data.control.param & 0x3f80) >> 7;
|
||||||
bytes[1] = (ev->data.control.param & 0x3f80) >> 7;
|
bytes[1] = ev->data.control.param & 0x007f;
|
||||||
bytes[2] = ev->data.control.value & 0x007f;
|
bytes[2] = (ev->data.control.value & 0x3f80) >> 7;
|
||||||
bytes[3] = (ev->data.control.value & 0x3f80) >> 7;
|
bytes[3] = ev->data.control.value & 0x007f;
|
||||||
if (cmd != dev->lastcmd && !dev->nostat) {
|
if (cmd != dev->lastcmd && !dev->nostat) {
|
||||||
if (count < 9)
|
if (count < 9)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue