Changeset c79a340d36130d8f4bd4898a0c076de2472b52ef
- 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
| rfb7f7d2 |
rc79a340 |
|
| 182 | 182 | unsigned i_refcount; |
|---|
| 183 | 183 | vlc_destructor_t pf_destructor; |
|---|
| 184 | | bool b_attached; |
|---|
| 185 | 184 | }; |
|---|
| 186 | 185 | |
|---|
| r30066f7 |
rc79a340 |
|
| 120 | 120 | p_new->b_error = false; |
|---|
| 121 | 121 | p_new->b_dead = false; |
|---|
| 122 | | p_priv->b_attached = false; |
|---|
| 123 | 122 | p_new->b_force = false; |
|---|
| 124 | 123 | |
|---|
| … | … | |
| 147 | 146 | p_libvlc_global->i_objects = 0; |
|---|
| 148 | 147 | p_libvlc_global->pp_objects = NULL; |
|---|
| 149 | | p_priv->b_attached = true; |
|---|
| 150 | 148 | vlc_mutex_init( &structure_lock ); |
|---|
| 151 | 149 | } |
|---|
| … | … | |
| 154 | 152 | p_libvlc_global = vlc_global(); |
|---|
| 155 | 153 | if( i_type == VLC_OBJECT_LIBVLC ) |
|---|
| 156 | | { |
|---|
| 157 | 154 | p_new->p_libvlc = (libvlc_int_t*)p_new; |
|---|
| 158 | | p_priv->b_attached = true; |
|---|
| 159 | | } |
|---|
| 160 | 155 | else |
|---|
| 161 | | { |
|---|
| 162 | 156 | p_new->p_libvlc = p_this->p_libvlc; |
|---|
| 163 | | } |
|---|
| 164 | 157 | } |
|---|
| 165 | 158 | |
|---|
| … | … | |
| 915 | 908 | p_parent->i_children, p_this ); |
|---|
| 916 | 909 | |
|---|
| 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 | | |
|---|
| 923 | 910 | vlc_mutex_unlock( &structure_lock ); |
|---|
| 924 | 911 | } |
|---|
| … | … | |
| 928 | 915 | { |
|---|
| 929 | 916 | 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 ); |
|---|
| 934 | 917 | |
|---|
| 935 | 918 | DetachObject( p_this ); |
|---|
| … | … | |
| 1047 | 1030 | |
|---|
| 1048 | 1031 | 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, "" ); |
|---|
| 1061 | 1033 | |
|---|
| 1062 | 1034 | vlc_mutex_unlock( &structure_lock ); |
|---|
| … | … | |
| 1413 | 1385 | } |
|---|
| 1414 | 1386 | |
|---|
| 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 | | } |
|---|
| 1432 | 1387 | |
|---|
| 1433 | 1388 | static void PrintObject( vlc_object_t *p_this, const char *psz_prefix ) |
|---|