client-node: don't try to clear port when destroyed

When the client destroyed a port, don't try to clear the
buffers because the client should have done that already.
This commit is contained in:
Wim Taymans 2020-04-21 15:54:51 +02:00
parent 90054f5f3e
commit ee5c3349a0

View file

@ -99,10 +99,12 @@ struct port {
struct spa_port_info info; struct spa_port_info info;
struct pw_properties *properties; struct pw_properties *properties;
unsigned int removed:1;
uint32_t n_params; uint32_t n_params;
struct spa_pod **params; struct spa_pod **params;
unsigned int removed:1;
unsigned int destroyed:1;
struct mix mix[MAX_MIX+1]; struct mix mix[MAX_MIX+1];
}; };
@ -747,6 +749,9 @@ do_port_use_buffers(struct impl *impl,
if (this->resource == NULL) if (this->resource == NULL)
return n_buffers == 0 ? 0 : -EIO; return n_buffers == 0 ? 0 : -EIO;
if (p->destroyed)
return 0;
for (i = 0; i < n_buffers; i++) { for (i = 0; i < n_buffers; i++) {
struct buffer *b = &mix->buffers[i]; struct buffer *b = &mix->buffers[i];
struct pw_memblock *mem, *m; struct pw_memblock *mem, *m;
@ -960,6 +965,7 @@ client_node_port_update(void *data,
port = GET_PORT(this, direction, port_id); port = GET_PORT(this, direction, port_id);
if (remove) { if (remove) {
port->destroyed = true;
clear_port(this, port); clear_port(this, port);
} else { } else {
struct port *target; struct port *target;