From 1717ff336e9eb3c544cf987fe195e8fd68b40163 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 18 Sep 2025 15:21:50 +0200 Subject: [PATCH] impl-port: init some stuff earlier Initialize the mix_hooks, port_map and latency earlier, before we call pw_impl_port_set_mix() and update_info, that could potentially expect this to be initialized. --- src/pipewire/impl-port.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pipewire/impl-port.c b/src/pipewire/impl-port.c index c85b05b88..f0ae5487c 100644 --- a/src/pipewire/impl-port.c +++ b/src/pipewire/impl-port.c @@ -800,6 +800,12 @@ struct pw_impl_port *pw_context_create_port( spa_list_init(&this->control_list[1]); spa_hook_list_init(&this->listener_list); + spa_hook_list_init(&impl->mix_hooks); + + pw_map_init(&this->mix_port_map, 64, 64); + + this->latency[SPA_DIRECTION_INPUT] = SPA_LATENCY_INFO(SPA_DIRECTION_INPUT); + this->latency[SPA_DIRECTION_OUTPUT] = SPA_LATENCY_INFO(SPA_DIRECTION_OUTPUT); if (this->direction == PW_DIRECTION_INPUT) mix_methods = &schedule_mix_node; @@ -810,15 +816,9 @@ struct pw_impl_port *pw_context_create_port( SPA_TYPE_INTERFACE_Node, SPA_VERSION_NODE, mix_methods, impl); - spa_hook_list_init(&impl->mix_hooks); pw_impl_port_set_mix(this, NULL, 0); - pw_map_init(&this->mix_port_map, 64, 64); - - this->latency[SPA_DIRECTION_INPUT] = SPA_LATENCY_INFO(SPA_DIRECTION_INPUT); - this->latency[SPA_DIRECTION_OUTPUT] = SPA_LATENCY_INFO(SPA_DIRECTION_OUTPUT); - if (info) update_info(this, info);