int __vlc_object_waitpipe( vlc_object_t *obj )
{
int pfd[2] = { -1, -1 };
- struct vlc_object_internals_t *internals = obj->p_internals;
+ vlc_object_internals_t *internals = vlc_internals( obj );
bool killed = false;
vlc_spin_lock (&internals->spin);
*/
void __vlc_object_kill( vlc_object_t *p_this )
{
- struct vlc_object_internals_t *internals = p_this->p_internals;
+ vlc_object_internals_t *internals = vlc_internals( p_this );
int fd;
vlc_mutex_lock( &p_this->object_lock );
{
/* This happens when there are only two remaining objects */
if( pp_objects[i_middle+1]->i_object_id == i_id
- && pp_objects[i_middle+1]->p_internals->i_refcount > 0 )
+ && vlc_internals( pp_objects[i_middle+1] )->i_refcount > 0 )
{
vlc_object_yield_locked( pp_objects[i_middle+1] );
vlc_mutex_unlock( &structure_lock );
break;
}
}
- else if( pp_objects[i_middle]->p_internals->i_refcount > 0 )
+ else if( vlc_internals( pp_objects[i_middle] )->i_refcount > 0 )
{
vlc_object_yield_locked( pp_objects[i_middle] );
vlc_mutex_unlock( &structure_lock );
/* If we are of the requested type ourselves, don't look further */
if( !(i_mode & FIND_STRICT) && p_this->i_object_type == i_type
- && p_this->p_internals->i_refcount > 0 )
+ && vlc_internals( p_this )->i_refcount > 0 )
{
vlc_object_yield_locked( p_this );
vlc_mutex_unlock( &structure_lock );
vlc_mutex_lock( &structure_lock );
/* Avoid obvious freed object uses */
- assert( p_this->p_internals->i_refcount > 0 );
+ assert( vlc_internals( p_this )->i_refcount > 0 );
/* If have the requested name ourselves, don't look further */
if( !(i_mode & FIND_STRICT)
&& p_this->psz_object_name
&& !strcmp( p_this->psz_object_name, psz_name )
- && p_this->p_internals->i_refcount > 0 )
+ && vlc_internals( p_this )->i_refcount > 0 )
{
vlc_object_yield_locked( p_this );
vlc_mutex_unlock( &structure_lock );
vlc_assert_locked (&structure_lock);
/* Avoid obvious freed object uses */
- assert( p_this->p_internals->i_refcount > 0 );
+ assert( vlc_internals( p_this )->i_refcount > 0 );
/* Increment the counter */
- p_this->p_internals->i_refcount++;
+ vlc_internals( p_this )->i_refcount++;
}
/* Public function */
vlc_mutex_lock( &structure_lock );
- assert( p_this->p_internals->i_refcount > 0 );
- p_this->p_internals->i_refcount--;
- b_should_destroy = (p_this->p_internals->i_refcount == 0);
+ assert( vlc_internals( p_this )->i_refcount > 0 );
+ vlc_internals( p_this )->i_refcount--;
+ b_should_destroy = (vlc_internals( p_this )->i_refcount == 0);
if( b_should_destroy )
{
vlc_mutex_lock( &structure_lock );
/* Avoid obvious freed object uses */
- assert( p_this->p_internals->i_refcount > 0 );
+ assert( vlc_internals( p_this )->i_refcount > 0 );
/* Attach the parent to its child */
p_this->p_parent = p_parent;
p_parent->i_children, p_this );
/* Climb up the tree to see whether we are connected with the root */
- if( p_parent->p_internals->b_attached )
+ if( vlc_internals( p_parent )->b_attached )
{
SetAttachment( p_this, true );
}
}
/* Climb up the tree to see whether we are connected with the root */
- if( p_this->p_parent->p_internals->b_attached )
+ if( vlc_internals( p_this->p_parent )->b_attached )
{
SetAttachment( p_this, false );
}
for( ; pp_current < pp_end ; pp_current++ )
{
- if( (*pp_current)->p_internals->b_attached
+ if( vlc_internals(*pp_current)->b_attached
&& (*pp_current)->i_object_type == i_type )
{
i_count++;
for( ; pp_current < pp_end ; pp_current++ )
{
- if( (*pp_current)->p_internals->b_attached
+ if( vlc_internals(*pp_current)->b_attached
&& (*pp_current)->i_object_type == i_type )
{
ListReplace( p_list, *pp_current, i_index );
for( ; pp_current < pp_end ; pp_current++ )
{
- if( (*pp_current)->p_internals->b_attached )
+ if( vlc_internals(*pp_current)->b_attached )
{
PrintObject( *pp_current, "" );
}
PrintObject( p_object, "" );
- if( !p_object->p_internals->i_vars )
+ if( !vlc_internals( p_object )->i_vars )
printf( " `-o No variables\n" );
- for( i = 0; i < p_object->p_internals->i_vars; i++ )
+ for( i = 0; i < vlc_internals( p_object )->i_vars; i++ )
{
- variable_t *p_var = p_object->p_internals->p_vars + i;
+ variable_t *p_var = vlc_internals( p_object )->p_vars + i;
const char *psz_type = "unknown";
switch( p_var->i_type & VLC_VAR_TYPE )
#undef MYCASE
}
printf( " %c-o \"%s\" (%s",
- i + 1 == p_object->p_internals->i_vars ? '`' : '|',
+ i + 1 == vlc_internals( p_object )->i_vars ? '`' : '|',
p_var->psz_name, psz_type );
if( p_var->psz_text )
printf( ", %s", p_var->psz_text );
if( p_tmp )
{
if( p_tmp->i_object_type == i_type
- && p_tmp->p_internals->i_refcount > 0 )
+ && vlc_internals( p_tmp )->i_refcount > 0 )
{
vlc_object_yield_locked( p_tmp );
return p_tmp;
{
p_tmp = p_this->pp_children[i];
if( p_tmp->i_object_type == i_type
- && p_tmp->p_internals->i_refcount > 0 )
+ && vlc_internals( p_tmp )->i_refcount > 0 )
{
vlc_object_yield_locked( p_tmp );
return p_tmp;
{
if( p_tmp->psz_object_name
&& !strcmp( p_tmp->psz_object_name, psz_name )
- && p_tmp->p_internals->i_refcount > 0 )
+ && vlc_internals( p_tmp )->i_refcount > 0 )
{
vlc_object_yield_locked( p_tmp );
return p_tmp;
p_tmp = p_this->pp_children[i];
if( p_tmp->psz_object_name
&& !strcmp( p_tmp->psz_object_name, psz_name )
- && p_tmp->p_internals->i_refcount > 0 )
+ && vlc_internals( p_tmp )->i_refcount > 0 )
{
vlc_object_yield_locked( p_tmp );
return p_tmp;
SetAttachment( p_this->pp_children[i_index], b_attached );
}
- p_this->p_internals->b_attached = b_attached;
+ vlc_internals( p_this )->b_attached = b_attached;
}
static void PrintObject( vlc_object_t *p_this, const char *psz_prefix )
}
psz_refcount[0] = '\0';
- if( p_this->p_internals->i_refcount > 0 )
+ if( vlc_internals( p_this )->i_refcount > 0 )
snprintf( psz_refcount, 19, ", refcount %u",
- p_this->p_internals->i_refcount );
+ vlc_internals( p_this )->i_refcount );
psz_thread[0] = '\0';
- if( p_this->p_internals->b_thread )
+ if( vlc_internals( p_this )->b_thread )
snprintf( psz_thread, 29, " (thread %u)",
#if defined(WIN32) || defined(UNDER_CE)
- (unsigned)p_this->p_internals->thread_id.id );
+ (unsigned)vlc_internals( p_this )->thread_id.id );
#else
- (unsigned)p_this->p_internals->thread_id );
+ (unsigned)vlc_internals( p_this )->thread_id );
#endif
psz_parent[0] = '\0';