global: limit the id to 24 bits

This leaves some extra bits for applications to mark things.
This commit is contained in:
Wim Taymans 2022-01-13 10:00:25 +01:00
parent 3c68476984
commit b8f8409980

View file

@ -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);