From b8f8409980a11556fde79040c9be05a0da2bb52c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 13 Jan 2022 10:00:25 +0100 Subject: [PATCH] global: limit the id to 24 bits This leaves some extra bits for applications to mark things. --- src/pipewire/global.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pipewire/global.c b/src/pipewire/global.c index 70e296c51..632cc2424 100644 --- a/src/pipewire/global.c +++ b/src/pipewire/global.c @@ -36,7 +36,7 @@ PW_LOG_TOPIC_EXTERN(log_global); #define PW_LOG_TOPIC_DEFAULT log_global -static uint64_t serial = 0; +static uint32_t serial = 0; /** \cond */ struct impl { @@ -96,9 +96,7 @@ pw_global_new(struct pw_context *context, this->func = func; this->object = object; this->properties = properties; - this->id = serial++; - if ((uint32_t)this->id == SPA_ID_INVALID) - this->id = serial++; + this->id = serial++ & 0xffffff; spa_list_init(&this->resource_list); spa_hook_list_init(&this->listener_list);