Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6565
b: refs/heads/master
c: c347e9f
h: refs/heads/master
i:
  6563: 6d750c2
v: v3
  • Loading branch information
Clemens Ladisch authored and Jaroslav Kysela committed Aug 30, 2005
1 parent 558a849 commit 3992355
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a278655ff5d0c9d5eb34cf99f3a4c20da09eb09e
refs/heads/master: c347e9fca710551f0def6a4d58505a6f4c0d87f6
17 changes: 12 additions & 5 deletions trunk/sound/usb/usbmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,17 +594,20 @@ 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;
int i;

/* FF indicates end of valid data */
for (i = 0; i < buffer_length; ++i)
if (buffer[i] == 0xff) {
buffer_length = i;
break;
}

/* handle F5 at end of last buffer */
if (ep->seen_f5)
goto switch_port;

while (buffer_length > 0) {
int i;

/* determine size of data until next F5 */
for (i = 0; i < buffer_length; ++i)
if (buffer[i] == 0xf5)
Expand Down Expand Up @@ -671,6 +674,10 @@ static void snd_usbmidi_emagic_output(snd_usb_midi_out_endpoint_t* ep)
break;
}
}
if (buf_free < ep->max_transfer && buf_free > 0) {
*buf = 0xff;
--buf_free;
}
ep->urb->transfer_buffer_length = ep->max_transfer - buf_free;
}

Expand Down

0 comments on commit 3992355

Please sign in to comment.