diff --git a/include/vlc_objects.h b/include/vlc_objects.h index fc95150cea2de2a379149f1f017e331d29f55cf2..4b4527c4f7cf63c1cdfec929b5790f43bd6b02ff 100644 --- a/include/vlc_objects.h +++ b/include/vlc_objects.h @@ -29,6 +29,7 @@ */ struct vlc_logger; +struct vlc_object_internals; /** * VLC object common members @@ -40,6 +41,7 @@ struct vlc_logger; struct vlc_common_members { struct vlc_logger *logger; + struct vlc_object_internals *priv; bool no_interact; diff --git a/src/misc/objects.c b/src/misc/objects.c index e03f32ae7045980dd8e4ec9dfe6eb38f08cb73ba..7ca420c3dc0f8e4a351407a1fd3fcfa730f89f11 100644 --- a/src/misc/objects.c +++ b/src/misc/objects.c @@ -85,6 +85,8 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length, priv->resources = NULL; vlc_object_t *obj = (vlc_object_t *)(priv + 1); + + obj->obj.priv = priv; obj->obj.force = false; memset (obj + 1, 0, length - sizeof (*obj)); /* type-specific stuff */ diff --git a/src/misc/variables.h b/src/misc/variables.h index 4d214e455af255750200a0ea449711e1086e5aef..63f9d49239eb823716206e170d488dbad5f6a66e 100644 --- a/src/misc/variables.h +++ b/src/misc/variables.h @@ -48,7 +48,7 @@ struct vlc_object_internals struct vlc_res *resources; }; -# define vlc_internals( obj ) (((vlc_object_internals_t*)(VLC_OBJECT(obj)))-1) +# define vlc_internals(o) ((o)->obj.priv) # define vlc_externals( priv ) ((vlc_object_t *)((priv) + 1)) extern void var_DestroyAll( vlc_object_t * );