mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
client-node: keep port buffers in special location
Keep the output port buffers in a special mix info. They should stay there even when the mix is removed and should only be cleared explicitly with a NULL Format or 0 use_buffers.
This commit is contained in:
parent
96ba0fbdeb
commit
0af87d2685
2 changed files with 9 additions and 4 deletions
|
|
@ -618,7 +618,7 @@ impl_node_port_set_param(void *object,
|
|||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
|
||||
pw_log_debug(NAME" %p: port %d.%d add param %s %d", this,
|
||||
pw_log_debug(NAME" %p: port %d.%d set param %s %d", this,
|
||||
direction, port_id,
|
||||
spa_debug_type_find_name(spa_type_param, id), id);
|
||||
|
||||
|
|
@ -627,8 +627,7 @@ impl_node_port_set_param(void *object,
|
|||
if (id == SPA_PARAM_Format) {
|
||||
for (i = 0; i < MAX_MIX+1; i++) {
|
||||
struct mix *mix = &port->mix[i];
|
||||
if (mix->valid)
|
||||
clear_buffers(this, mix);
|
||||
clear_buffers(this, mix);
|
||||
}
|
||||
}
|
||||
if (this->resource == NULL)
|
||||
|
|
@ -732,6 +731,9 @@ do_port_use_buffers(struct impl *impl,
|
|||
if (!p->have_format)
|
||||
return -EIO;
|
||||
|
||||
if (direction == SPA_DIRECTION_OUTPUT)
|
||||
mix_id = SPA_ID_INVALID;
|
||||
|
||||
if ((mix = find_mix(p, mix_id)) == NULL || !mix->valid)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -1015,10 +1017,12 @@ static int client_node_port_buffers(void *data,
|
|||
if (!p->have_format)
|
||||
return -EIO;
|
||||
|
||||
if (direction == SPA_DIRECTION_OUTPUT)
|
||||
mix_id = SPA_ID_INVALID;
|
||||
|
||||
if ((mix = find_mix(p, mix_id)) == NULL || !mix->valid)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
for (i = 0; i < n_buffers; i++) {
|
||||
struct spa_buffer *oldbuf, *newbuf;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue