Browse Source

objects: remove the libvlc pointer

pull/85/head
Rémi Denis-Courmont 7 years ago
parent
commit
7dcc3cbf17
  1. 10
      include/vlc_objects.h
  2. 2
      src/misc/objects.c

10
include/vlc_objects.h

@ -59,12 +59,6 @@ struct vlc_common_members
*/
bool force;
/** LibVLC instance
*
* Root VLC object of the objects tree that this object belongs in.
*/
libvlc_int_t *libvlc;
/** Parent object
*
* The parent VLC object in the objects tree. For the root (the LibVLC
@ -133,7 +127,9 @@ VLC_API char *vlc_object_get_name( const vlc_object_t * ) VLC_USED;
VLC_USED
static inline libvlc_int_t *vlc_object_instance(vlc_object_t *obj)
{
return obj->obj.libvlc;
while (obj->obj.parent != NULL)
obj = obj->obj.parent;
return (libvlc_int_t *)obj;
}
#define vlc_object_instance(o) vlc_object_instance(VLC_OBJECT(o))

2
src/misc/objects.c

@ -220,7 +220,6 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
vlc_object_internals_t *papriv = vlc_internals (parent);
obj->obj.flags = parent->obj.flags;
obj->obj.libvlc = vlc_object_instance(parent);
/* Attach the child to its parent (no lock needed) */
obj->obj.parent = vlc_object_hold (parent);
@ -235,7 +234,6 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
libvlc_int_t *self = (libvlc_int_t *)obj;
obj->obj.flags = 0;
obj->obj.libvlc = self;
obj->obj.parent = NULL;
/* TODO: should be in src/libvlc.c */

Loading…
Cancel
Save