diff --git a/src/pipewire/link.c b/src/pipewire/link.c index fd6e3fb07..1fc08742e 100644 --- a/src/pipewire/link.c +++ b/src/pipewire/link.c @@ -632,8 +632,14 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s output = this->output; pw_log_debug("link %p: doing alloc buffers %p %p", this, output->node, input->node); - oinfo = &output->spa_info; - iinfo = &input->spa_info; + if ((res = spa_node_port_get_info(input->node->node, + input->direction, input->port_id, + &iinfo)) < 0) + return res; + if ((res = spa_node_port_get_info(output->node->node, + output->direction, output->port_id, + &oinfo)) < 0) + return res; in_flags = iinfo->flags; out_flags = oinfo->flags; diff --git a/src/pipewire/port.c b/src/pipewire/port.c index adbcce89f..0676c1455 100644 --- a/src/pipewire/port.c +++ b/src/pipewire/port.c @@ -329,7 +329,6 @@ static int do_add_port(struct spa_loop *loop, struct pw_port *this = user_data; struct spa_graph_node *out, *in; - this->rt.port.flags = this->spa_info.flags; spa_graph_port_add(&this->node->rt.node, &this->rt.port); spa_graph_port_add(&this->rt.mix_node, &this->rt.mix_port); spa_graph_port_link(&this->rt.port, &this->rt.mix_port); @@ -518,14 +517,11 @@ int pw_port_add(struct pw_port *port, struct pw_node *node) &spa_info)) < 0) goto info_failed; } - - port->node = node; - port->spa_info = *spa_info; - port->spa_info.props = NULL; - if (spa_info->props) pw_port_update_properties(port, spa_info->props); + port->node = node; + pw_node_events_port_init(node, port); pw_port_for_each_param(port, SPA_PARAM_IO, 0, 0, NULL, check_param_io, port); @@ -548,12 +544,12 @@ int pw_port_add(struct pw_port *port, struct pw_node *node) } } - if (SPA_FLAG_CHECK(port->spa_info.flags, SPA_PORT_INFO_FLAG_PHYSICAL)) + if (SPA_FLAG_CHECK(spa_info->flags, SPA_PORT_INFO_FLAG_PHYSICAL)) pw_properties_set(port->properties, "port.physical", "1"); - if (SPA_FLAG_CHECK(port->spa_info.flags, SPA_PORT_INFO_FLAG_TERMINAL)) + if (SPA_FLAG_CHECK(spa_info->flags, SPA_PORT_INFO_FLAG_TERMINAL)) pw_properties_set(port->properties, "port.terminal", "1"); - pw_log_debug("port %p: %d add to node %p %08x", port, port_id, node, port->spa_info.flags); + pw_log_debug("port %p: %d add to node %p %08x", port, port_id, node, spa_info->flags); spa_list_append(ports, &port->link); pw_map_insert_at(portmap, port_id, port); diff --git a/src/pipewire/private.h b/src/pipewire/private.h index 502da928e..74f52dce0 100644 --- a/src/pipewire/private.h +++ b/src/pipewire/private.h @@ -403,7 +403,6 @@ struct pw_port { enum pw_direction direction; /**< port direction */ uint32_t port_id; /**< port id */ - struct spa_port_info spa_info; struct pw_properties *properties; /**< properties of the port */ struct pw_port_info info;