From 8848923d8286ef550e02ba72860babce38bbfbe8 Mon Sep 17 00:00:00 2001 From: t123yh Date: Sat, 21 Oct 2023 12:45:11 -0700 Subject: [PATCH] examples: add props to bluez-session to prevent quirk parse error In bluez5-dbus.c:impl_init, the info is passed to spa_bt_quirks_create, which expects info to be non-null. But in this example, info is null, so it will cause quirk table parse failure. Add an empty dict here to prevent this error. --- src/examples/bluez-session.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/examples/bluez-session.c b/src/examples/bluez-session.c index 041594ac5..fffe2f4ad 100644 --- a/src/examples/bluez-session.c +++ b/src/examples/bluez-session.c @@ -71,6 +71,7 @@ struct impl { struct spa_hook listener; struct spa_list device_list; + struct pw_properties *props; }; static struct node *find_node(struct object *obj, uint32_t id) @@ -302,7 +303,7 @@ static int start_monitor(struct impl *impl) int res; void *iface; - handle = pw_context_load_spa_handle(impl->context, SPA_NAME_API_BLUEZ5_ENUM_DBUS, NULL); + handle = pw_context_load_spa_handle(impl->context, SPA_NAME_API_BLUEZ5_ENUM_DBUS, &impl->props->dict); if (handle == NULL) { res = -errno; goto out; @@ -362,6 +363,10 @@ int main(int argc, char *argv[]) return -1; } + if ((impl.props = pw_properties_new(NULL, NULL)) == NULL) { + return -1; + } + pw_core_add_listener(impl.core, &impl.core_listener, &core_events, &impl);