mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -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);
|
PW_LOG_TOPIC_EXTERN(log_global);
|
||||||
#define PW_LOG_TOPIC_DEFAULT log_global
|
#define PW_LOG_TOPIC_DEFAULT log_global
|
||||||
|
|
||||||
static uint64_t serial = 0;
|
|
||||||
|
|
||||||
/** \cond */
|
/** \cond */
|
||||||
struct impl {
|
struct impl {
|
||||||
struct pw_global this;
|
struct pw_global this;
|
||||||
|
|
@ -122,10 +120,11 @@ error_cleanup:
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
uint64_t pw_global_get_serial(struct pw_global *global)
|
uint64_t pw_global_get_serial(struct pw_global *global)
|
||||||
{
|
{
|
||||||
|
struct pw_context *context = global->context;
|
||||||
if (global->serial == SPA_ID_INVALID)
|
if (global->serial == SPA_ID_INVALID)
|
||||||
global->serial = serial++;
|
global->serial = context->serial++;
|
||||||
if ((uint32_t)serial == SPA_ID_INVALID)
|
if ((uint32_t)context->serial == SPA_ID_INVALID)
|
||||||
serial++;
|
context->serial++;
|
||||||
return global->serial;
|
return global->serial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -424,6 +424,7 @@ struct pw_context {
|
||||||
|
|
||||||
struct pw_mempool *pool; /**< global memory pool */
|
struct pw_mempool *pool; /**< global memory pool */
|
||||||
|
|
||||||
|
uint64_t serial;
|
||||||
struct pw_map globals; /**< map of globals */
|
struct pw_map globals; /**< map of globals */
|
||||||
|
|
||||||
struct spa_list core_impl_list; /**< list of core_imp */
|
struct spa_list core_impl_list; /**< list of core_imp */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue