mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-04 03:03:00 -04:00
midi: don't write trailing continuation 0xf0 for SysEx
Because our midi messages already have a size, we don't need the 0xf0 continuation terminator. Also having the terminator optionally requires you to check and strip it if it's there. The easiest algorithm is to check the first byte for start (0xf0) or continuation (0xf7) and the last byte for end (0xf7) and that should be enough to process the messages without having to ever stip the last byte.
This commit is contained in:
parent
b41d117609
commit
350eb9a041
10 changed files with 52 additions and 35 deletions
|
|
@ -886,8 +886,6 @@ static int process_write(struct seq_state *state)
|
|||
continue;
|
||||
|
||||
if (body[0] == 0xf0 || body[0] == 0xf7) {
|
||||
if (body[body_size-1] == 0xf0)
|
||||
body_size -= 1;
|
||||
if (body[0] == 0xf7) {
|
||||
body += 1;
|
||||
body_size -= 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue