mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-22 21:37:38 -04:00
seq: the training 0xf0 in continuations is optional
This is not strictly required because our control events have a size and don't need the 0xf0 trailing byte to find the boundary. It also makes it easier to just use the midifile events directly without having to add the 0xf0.
This commit is contained in:
parent
fdb08f3c60
commit
4e1257a6e6
2 changed files with 5 additions and 9 deletions
|
|
@ -629,7 +629,7 @@ static int process_read(struct seq_state *state)
|
|||
/* copy all new midi events into their port buffers */
|
||||
while (1) {
|
||||
const snd_seq_addr_t *addr;
|
||||
uint8_t head = 0, tail = 0, extra = 0, *dst;
|
||||
uint8_t head = 0, extra = 0, *dst;
|
||||
uint64_t ev_time, diff;
|
||||
uint32_t offset;
|
||||
void *event;
|
||||
|
|
@ -715,10 +715,6 @@ static int process_read(struct seq_state *state)
|
|||
size = ev->data.ext.len;
|
||||
data = dst = ev->data.ext.ptr;
|
||||
|
||||
if (dst[size-1] != 0xf7) {
|
||||
tail = 0xf0;
|
||||
extra++;
|
||||
}
|
||||
if (dst[0] != 0xf0) {
|
||||
head = 0xf7;
|
||||
extra++;
|
||||
|
|
@ -739,8 +735,6 @@ static int process_read(struct seq_state *state)
|
|||
|
||||
spa_pod_builder_control(&port->builder, offset, ump ? SPA_CONTROL_UMP : SPA_CONTROL_Midi );
|
||||
dst = spa_pod_builder_reserve_bytes(&port->builder, size + extra);
|
||||
if (tail)
|
||||
dst[size+extra-1] = tail;
|
||||
if (head) {
|
||||
dst[0] = head;
|
||||
dst++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue