From dfc5fd86a7c4561402a010721dc2b5a9f3390eca Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 30 Apr 2026 16:27:15 +0200 Subject: [PATCH] pulse: only fixate when necessary Check if the format is already fixated before doing a copy and fixate. The copy can fail so we need to check this. --- src/modules/module-protocol-pulse/collect.c | 14 ++++++++++---- src/modules/module-protocol-pulse/pending-sample.c | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/module-protocol-pulse/collect.c b/src/modules/module-protocol-pulse/collect.c index d24608b98..71fa98f10 100644 --- a/src/modules/module-protocol-pulse/collect.c +++ b/src/modules/module-protocol-pulse/collect.c @@ -287,11 +287,17 @@ static void collect_device_info(struct pw_manager_object *device, struct pw_mana switch (p->id) { case SPA_PARAM_EnumFormat: { - struct spa_pod *copy = spa_pod_copy(p->param); - spa_pod_fixate(copy); - format_parse_param(copy, true, &dev_info->ss, &dev_info->map, + struct spa_pod *to_free = NULL, *c = p->param; + if (!spa_pod_is_fixated(c)) { + to_free = spa_pod_copy(c); + if (to_free == NULL) + break; + spa_pod_fixate(to_free); + c = to_free; + } + format_parse_param(c, true, &dev_info->ss, &dev_info->map, &defs->sample_spec, &defs->channel_map); - free(copy); + free(to_free); break; } case SPA_PARAM_Format: diff --git a/src/modules/module-protocol-pulse/pending-sample.c b/src/modules/module-protocol-pulse/pending-sample.c index 98adce575..a50960b99 100644 --- a/src/modules/module-protocol-pulse/pending-sample.c +++ b/src/modules/module-protocol-pulse/pending-sample.c @@ -50,7 +50,6 @@ static void sample_play_ready_reply(void *data, struct client *client, uint32_t message_put(reply, TAG_U32, index, TAG_INVALID); - client_queue_message(client, reply); ps->replied = true; }