mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
alsa-seq: try to not overflow the output buffer
Keep some room in the output buffer to store the worst case event and save it for the next cycle.
This commit is contained in:
parent
e897a8afc4
commit
7e87bd9b34
1 changed files with 7 additions and 0 deletions
|
|
@ -553,6 +553,13 @@ static int process_read(struct seq_state *state)
|
|||
spa_pod_builder_bytes(&port->builder, data, size);
|
||||
|
||||
snd_seq_free_event(ev);
|
||||
|
||||
/* make sure we can fit at least one control event of max size otherwise
|
||||
* we keep the event in the queue and try to copy it in the next cycle */
|
||||
if (port->builder.state.offset +
|
||||
sizeof(struct spa_pod_control) +
|
||||
MAX_EVENT_SIZE > port->buffer->buf->datas[0].maxsize)
|
||||
break;
|
||||
}
|
||||
|
||||
/* prepare a buffer on each port, some ports might have their
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue