From 70ffbaed745c23b8415f17745d76623faa4190f1 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Mon, 8 Jan 2024 21:51:35 +0200 Subject: [PATCH] bluez5: fix node initialization to init all nodes Now that we can have more than 4 nodes, so should init them all. --- spa/plugins/bluez5/bluez5-device.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spa/plugins/bluez5/bluez5-device.c b/spa/plugins/bluez5/bluez5-device.c index da9f3552e..0aba1c576 100644 --- a/spa/plugins/bluez5/bluez5-device.c +++ b/spa/plugins/bluez5/bluez5-device.c @@ -2832,6 +2832,7 @@ impl_init(const struct spa_handle_factory *factory, { struct impl *this; const char *str; + unsigned int i; spa_return_val_if_fail(factory != NULL, -EINVAL); spa_return_val_if_fail(handle != NULL, -EINVAL); @@ -2878,10 +2879,8 @@ impl_init(const struct spa_handle_factory *factory, reset_props(&this->props); - init_node(this, &this->nodes[0], 0); - init_node(this, &this->nodes[1], 1); - init_node(this, &this->nodes[2], 2); - init_node(this, &this->nodes[3], 3); + for (i = 0; i < SPA_N_ELEMENTS(this->nodes); ++i) + init_node(this, &this->nodes[i], i); this->info = SPA_DEVICE_INFO_INIT(); this->info_all = SPA_DEVICE_CHANGE_MASK_PROPS |