]> git.sesse.net Git - vlc/blobdiff - src/misc/objects.c
* ALL: got rid of p_object->p_this which is now useless.
[vlc] / src / misc / objects.c
index 7ba39d637e30048518b141e13970813511cc75e6..c63f33a55a92185331620c3fe20ccfc7bce868a9 100644 (file)
@@ -2,7 +2,7 @@
  * objects.c: vlc_object_t handling
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: objects.c,v 1.1 2002/06/01 12:32:01 sam Exp $
+ * $Id: objects.c,v 1.3 2002/06/01 18:04:49 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -96,13 +96,13 @@ static void vlc_dumpstructure_inner( vlc_object_t *p_this,
     psz_thread[0] = '\0';
     if( p_this->b_thread )
     {
-        snprintf( psz_thread, 20, " (thread %d)", p_this->thread_id );
+        snprintf( psz_thread, 20, " (thread %d)", p_this->i_thread );
         psz_thread[19] = '\0';
     }
 
     psz_foo[i_level] = '\0';
-    msg_Dbg( p_this, "%so %s %p%s%s%s%s", psz_foo, p_this->psz_object_type,
-             p_this, psz_name, psz_thread, psz_refcount, psz_children );
+    msg_Info( p_this, "%so %s %p%s%s%s%s", psz_foo, p_this->psz_object_type,
+              p_this, psz_name, psz_thread, psz_refcount, psz_children );
     psz_foo[i_level] = i_back;
 
     if( i_level / 2 >= MAX_TREE_DEPTH )
@@ -139,7 +139,7 @@ static void vlc_dumpstructure_inner( vlc_object_t *p_this,
     }
 }
 
-/* vlc_object_create: initialize a vlc object and set its parent */
+/* vlc_object_create: initialize a vlc object */
 void * __vlc_object_create( vlc_object_t *p_this, int i_type )
 {
     vlc_object_t * p_new;
@@ -181,7 +181,8 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
             psz_type = "audio output";
             break;
         default:
-            i_size = i_type;
+            i_size = i_type > sizeof(vlc_object_t)
+                   ? i_type : sizeof(vlc_object_t);
             i_type = VLC_OBJECT_PRIVATE;
             psz_type = "private";
             break;
@@ -205,8 +206,6 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
     p_new->b_die = 0;
     p_new->b_error = 0;
 
-    p_new->p_this = p_new;
-
     /* If i_type is root, then p_new is our own p_vlc */
     if( i_type == VLC_OBJECT_ROOT )
     {