mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
jack: clear buffers when freeing the mixer
This commit is contained in:
parent
48036f7d13
commit
90054f5f3e
1 changed files with 22 additions and 21 deletions
|
|
@ -412,8 +412,30 @@ static struct mix *ensure_mix(struct client *c, struct port *port, uint32_t mix_
|
||||||
return mix;
|
return mix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int clear_buffers(struct client *c, struct mix *mix)
|
||||||
|
{
|
||||||
|
struct port *port = mix->port;
|
||||||
|
struct buffer *b;
|
||||||
|
uint32_t i, j;
|
||||||
|
|
||||||
|
pw_log_debug(NAME" %p: port %p clear buffers", c, port);
|
||||||
|
|
||||||
|
for (i = 0; i < mix->n_buffers; i++) {
|
||||||
|
b = &mix->buffers[i];
|
||||||
|
|
||||||
|
for (j = 0; j < b->n_mem; j++)
|
||||||
|
pw_memmap_free(b->mem[j]);
|
||||||
|
|
||||||
|
b->n_mem = 0;
|
||||||
|
}
|
||||||
|
mix->n_buffers = 0;
|
||||||
|
spa_list_init(&mix->queue);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void free_mix(struct client *c, struct mix *mix)
|
static void free_mix(struct client *c, struct mix *mix)
|
||||||
{
|
{
|
||||||
|
clear_buffers(c, mix);
|
||||||
spa_list_remove(&mix->port_link);
|
spa_list_remove(&mix->port_link);
|
||||||
spa_list_append(&c->free_mix, &mix->link);
|
spa_list_append(&c->free_mix, &mix->link);
|
||||||
}
|
}
|
||||||
|
|
@ -1333,27 +1355,6 @@ static int client_node_remove_port(void *object,
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int clear_buffers(struct client *c, struct mix *mix)
|
|
||||||
{
|
|
||||||
struct port *port = mix->port;
|
|
||||||
struct buffer *b;
|
|
||||||
uint32_t i, j;
|
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: port %p clear buffers", c, port);
|
|
||||||
|
|
||||||
for (i = 0; i < mix->n_buffers; i++) {
|
|
||||||
b = &mix->buffers[i];
|
|
||||||
|
|
||||||
for (j = 0; j < b->n_mem; j++)
|
|
||||||
pw_memmap_free(b->mem[j]);
|
|
||||||
|
|
||||||
b->n_mem = 0;
|
|
||||||
}
|
|
||||||
mix->n_buffers = 0;
|
|
||||||
spa_list_init(&mix->queue);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int param_enum_format(struct client *c, struct port *p,
|
static int param_enum_format(struct client *c, struct port *p,
|
||||||
struct spa_pod **param, struct spa_pod_builder *b)
|
struct spa_pod **param, struct spa_pod_builder *b)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue