Commit 1f166d11 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] ignore Emagic padding bytes

USB generic driver
Ignore the 0xff padding bytes added by Emagic devices at the end
of input packets.
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent ea00ba34
......@@ -589,6 +589,10 @@ static void snd_usbmidi_emagic_finish_out(snd_usb_midi_out_endpoint_t* ep)
static void snd_usbmidi_emagic_input(snd_usb_midi_in_endpoint_t* ep,
uint8_t* buffer, int buffer_length)
{
/* ignore padding bytes at end of buffer */
while (buffer_length > 0 && buffer[buffer_length - 1] == 0xff)
--buffer_length;
/* handle F5 at end of last buffer */
if (ep->seen_f5)
goto switch_port;
......
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