diff --git a/src/misc/objects.c b/src/misc/objects.c index 7b15ae91d025cce02c529d89359124a2afb00031..f43549d1a1e58ffa90eea440045c47a024824564 100644 --- a/src/misc/objects.c +++ b/src/misc/objects.c @@ -69,7 +69,6 @@ int vlc_object_init(vlc_object_t *restrict obj, vlc_object_t *parent, priv->typename = typename; priv->var_root = NULL; vlc_mutex_init (&priv->var_lock); - vlc_cond_init (&priv->var_wait); priv->resources = NULL; obj->priv = priv; diff --git a/src/misc/variables.c b/src/misc/variables.c index ed284cf4f4c477a152a3c80510cb57a621edc8f0..f12e55d4e7d3ac05b1dae95de4a601ed7d3e4902 100644 --- a/src/misc/variables.c +++ b/src/misc/variables.c @@ -96,6 +96,8 @@ struct variable_t callback_entry_t *value_callbacks; /** Registered list callbacks */ callback_entry_t *list_callbacks; + + vlc_cond_t wait; }; static int CmpBool( vlc_value_t v, vlc_value_t w ) @@ -228,7 +230,7 @@ static void WaitUnused(vlc_object_t *obj, variable_t *var) mutex_cleanup_push(&priv->var_lock); while (var->b_incallback) - vlc_cond_wait(&priv->var_wait, &priv->var_lock); + vlc_cond_wait(&var->wait, &priv->var_lock); vlc_cleanup_pop(); } @@ -256,7 +258,7 @@ static void TriggerCallback(vlc_object_t *obj, variable_t *var, vlc_mutex_lock(&priv->var_lock); var->b_incallback = false; - vlc_cond_broadcast(&priv->var_wait); + vlc_cond_broadcast(&var->wait); } static void TriggerListCallback(vlc_object_t *obj, variable_t *var, @@ -283,7 +285,7 @@ static void TriggerListCallback(vlc_object_t *obj, variable_t *var, vlc_mutex_lock(&priv->var_lock); var->b_incallback = false; - vlc_cond_broadcast(&priv->var_wait); + vlc_cond_broadcast(&var->wait); } int (var_Create)( vlc_object_t *p_this, const char *psz_name, int i_type ) diff --git a/src/misc/variables.h b/src/misc/variables.h index 5ef84f1b2af9e1132419836e55dcbb6f01cd697b..711cd14b5a34cd41d9b2f54c3db918f1f9f555f3 100644 --- a/src/misc/variables.h +++ b/src/misc/variables.h @@ -40,7 +40,6 @@ struct vlc_object_internals /* Object variables */ void *var_root; vlc_mutex_t var_lock; - vlc_cond_t var_wait; /* Object resources */ struct vlc_res *resources;