diff --git a/src/modules/module-audio-dsp/audio-dsp.c b/src/modules/module-audio-dsp/audio-dsp.c index 2c9c8a1c8..f267d83d2 100644 --- a/src/modules/module-audio-dsp/audio-dsp.c +++ b/src/modules/module-audio-dsp/audio-dsp.c @@ -162,6 +162,7 @@ static void node_destroy(void *data) pw_properties_free(n->props); spa_list_for_each_safe(p, tmp, &n->ports, link) { + pw_port_set_mix(p->port, NULL, 0); spa_list_remove(&p->link); spa_handle_clear(p->spa_handle); free(p); diff --git a/src/modules/module-audio-dsp/floatmix.c b/src/modules/module-audio-dsp/floatmix.c index 0fefc574e..ef1999fe2 100644 --- a/src/modules/module-audio-dsp/floatmix.c +++ b/src/modules/module-audio-dsp/floatmix.c @@ -588,11 +588,11 @@ impl_node_port_use_buffers(struct spa_node *node, port = GET_PORT(this, direction, port_id); - spa_return_val_if_fail(port->have_format, -EIO); - spa_log_info(this->log, NAME " %p: use buffers %d on port %d:%d", this, n_buffers, direction, port_id); + spa_return_val_if_fail(port->have_format, -EIO); + clear_buffers(this, port); for (i = 0; i < n_buffers; i++) { diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index 29fcd9280..9b0ad234a 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -112,6 +112,7 @@ struct port { struct pw_properties *properties; int have_format:1; + int removed:1; uint32_t n_params; struct spa_pod **params; @@ -596,7 +597,7 @@ clear_port(struct node *this, struct port *port) spa_log_debug(this->log, "node %p: clear port %p", this, port); if (port == NULL) - return ; + return; do_update_port(this, port, PW_CLIENT_NODE_PORT_UPDATE_PARAMS | @@ -619,7 +620,8 @@ clear_port(struct node *this, struct port *port) this->n_outputs--; } } - spa_node_emit_port_info(&this->hooks, port->direction, port->id, NULL); + if (!port->removed) + spa_node_emit_port_info(&this->hooks, port->direction, port->id, NULL); } static int @@ -1518,6 +1520,7 @@ static void node_port_removed(void *data, struct pw_port *port) pw_log_debug("client-node %p: port %p remove", &impl->this, port); + p->removed = true; clear_port(this, p); } diff --git a/src/modules/module-client-node/client-stream.c b/src/modules/module-client-node/client-stream.c index 2ff275816..1b4c28943 100644 --- a/src/modules/module-client-node/client-stream.c +++ b/src/modules/module-client-node/client-stream.c @@ -1103,9 +1103,15 @@ static void client_node_destroy(void *data) pw_node_set_driver(impl->client_node->node, NULL); - spa_hook_remove(&impl->client_node_listener); spa_hook_remove(&impl->node_listener); pw_node_destroy(impl->this.node); +} + +static void client_node_free(void *data) +{ + struct impl *impl = data; + pw_log_debug("client-stream %p: free", &impl->this); + spa_hook_remove(&impl->client_node_listener); cleanup(impl); } @@ -1138,21 +1144,26 @@ static void client_node_info_changed(void *data, const struct pw_node_info *info static const struct pw_node_events client_node_events = { PW_VERSION_NODE_EVENTS, .destroy = client_node_destroy, + .free = client_node_free, .initialized = client_node_initialized, .result = client_node_result, .active_changed = client_node_active_changed, .info_changed = client_node_info_changed, }; +static void node_destroy(void *data) +{ + struct impl *impl = data; + pw_log_debug("client-stream %p: destroy", &impl->this); + spa_hook_remove(&impl->client_node_listener); + pw_client_node_destroy(impl->client_node); +} + static void node_free(void *data) { struct impl *impl = data; - pw_log_debug("client-stream %p: free", &impl->this); - spa_hook_remove(&impl->node_listener); - spa_hook_remove(&impl->client_node_listener); - pw_client_node_destroy(impl->client_node); cleanup(impl); } @@ -1184,6 +1195,7 @@ static void node_driver_changed(void *data, struct pw_node *old, struct pw_node static const struct pw_node_events node_events = { PW_VERSION_NODE_EVENTS, + .destroy = node_destroy, .free = node_free, .initialized = node_initialized, .peer_added = node_peer_added,