Changeset c79a340d36130d8f4bd4898a0c076de2472b52ef

Show
Ignore:
Timestamp:
05/14/08 20:14:47 (2 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1210788887 +0300
git-parent:

[30066f7bd1ce28d48032737de40d96bdff516bf4]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1210788887 +0300
Message:

Get rid of b_attached

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/libvlc.h

    rfb7f7d2 rc79a340  
    182182    unsigned         i_refcount; 
    183183    vlc_destructor_t pf_destructor; 
    184     bool             b_attached; 
    185184}; 
    186185 
  • src/misc/objects.c

    r30066f7 rc79a340  
    120120    p_new->b_error = false; 
    121121    p_new->b_dead = false; 
    122     p_priv->b_attached = false; 
    123122    p_new->b_force = false; 
    124123 
     
    147146        p_libvlc_global->i_objects = 0; 
    148147        p_libvlc_global->pp_objects = NULL; 
    149         p_priv->b_attached = true; 
    150148        vlc_mutex_init( &structure_lock ); 
    151149    } 
     
    154152        p_libvlc_global = vlc_global(); 
    155153        if( i_type == VLC_OBJECT_LIBVLC ) 
    156         { 
    157154            p_new->p_libvlc = (libvlc_int_t*)p_new; 
    158             p_priv->b_attached = true; 
    159         } 
    160155        else 
    161         { 
    162156            p_new->p_libvlc = p_this->p_libvlc; 
    163         } 
    164157    } 
    165158 
     
    915908                 p_parent->i_children, p_this ); 
    916909 
    917     /* Climb up the tree to see whether we are connected with the root */ 
    918     if( vlc_internals( p_parent )->b_attached ) 
    919     { 
    920         SetAttachment( p_this, true ); 
    921     } 
    922  
    923910    vlc_mutex_unlock( &structure_lock ); 
    924911} 
     
    928915{ 
    929916    assert (p_this->p_parent); 
    930  
    931     /* Climb up the tree to see whether we are connected with the root */ 
    932     if( vlc_internals( p_this->p_parent )->b_attached ) 
    933         SetAttachment( p_this, false ); 
    934917 
    935918    DetachObject( p_this ); 
     
    10471030 
    10481031        for( ; pp_current < pp_end ; pp_current++ ) 
    1049         { 
    1050             if( vlc_internals(*pp_current)->b_attached ) 
    1051             { 
    1052                 PrintObject( *pp_current, "" ); 
    1053             } 
    1054             else 
    1055             { 
    1056                 printf( " o %.8i %s (not attached)\n", 
    1057                         (*pp_current)->i_object_id, 
    1058                         (*pp_current)->psz_object_type ); 
    1059             } 
    1060         } 
     1032            PrintObject( *pp_current, "" ); 
    10611033 
    10621034        vlc_mutex_unlock( &structure_lock ); 
     
    14131385} 
    14141386 
    1415 /***************************************************************************** 
    1416  * SetAttachment: recursively set the b_attached flag of a subtree. 
    1417  ***************************************************************************** 
    1418  * This function is used by the attach and detach functions to propagate 
    1419  * the b_attached flag in a subtree. 
    1420  *****************************************************************************/ 
    1421 static void SetAttachment( vlc_object_t *p_this, bool b_attached ) 
    1422 { 
    1423     int i_index; 
    1424  
    1425     for( i_index = p_this->i_children ; i_index-- ; ) 
    1426     { 
    1427         SetAttachment( p_this->pp_children[i_index], b_attached ); 
    1428     } 
    1429  
    1430     vlc_internals( p_this )->b_attached = b_attached; 
    1431 } 
    14321387 
    14331388static void PrintObject( vlc_object_t *p_this, const char *psz_prefix )