mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
global: move serial counter to context
This commit is contained in:
parent
8698d5a548
commit
54d50b943f
2 changed files with 5 additions and 5 deletions
|
|
@ -36,8 +36,6 @@
|
|||
PW_LOG_TOPIC_EXTERN(log_global);
|
||||
#define PW_LOG_TOPIC_DEFAULT log_global
|
||||
|
||||
static uint64_t serial = 0;
|
||||
|
||||
/** \cond */
|
||||
struct impl {
|
||||
struct pw_global this;
|
||||
|
|
@ -122,10 +120,11 @@ error_cleanup:
|
|||
SPA_EXPORT
|
||||
uint64_t pw_global_get_serial(struct pw_global *global)
|
||||
{
|
||||
struct pw_context *context = global->context;
|
||||
if (global->serial == SPA_ID_INVALID)
|
||||
global->serial = serial++;
|
||||
if ((uint32_t)serial == SPA_ID_INVALID)
|
||||
serial++;
|
||||
global->serial = context->serial++;
|
||||
if ((uint32_t)context->serial == SPA_ID_INVALID)
|
||||
context->serial++;
|
||||
return global->serial;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -424,6 +424,7 @@ struct pw_context {
|
|||
|
||||
struct pw_mempool *pool; /**< global memory pool */
|
||||
|
||||
uint64_t serial;
|
||||
struct pw_map globals; /**< map of globals */
|
||||
|
||||
struct spa_list core_impl_list; /**< list of core_imp */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue