if( p_playlist->p_fetcher )
vlc_object_release( p_playlist->p_fetcher );
-#ifndef NDEBUG
- libvlc_priv (p_this->p_libvlc)->p_playlist = NULL; /* pl_Yield() will fail */
-#endif
+
+ msg_Dbg( p_this, "Destroyed" );
}
/* Destroy remaining objects */
static void ObjectGarbageCollector( playlist_t *p_playlist, bool b_force )
{
- vlc_object_t *p_obj;
-
if( !b_force )
{
if( mdate() - p_playlist->gc_date < 1000000 )
}
vlc_mutex_lock( &p_playlist->gc_lock );
- while( ( p_obj = vlc_object_find( p_playlist->p_libvlc, VLC_OBJECT_VOUT,
- FIND_CHILD ) ) )
- {
- vlc_object_release( p_obj );
- if( p_obj->p_parent == VLC_OBJECT(p_playlist->p_libvlc) )
- {
- msg_Dbg( p_playlist, "garbage collector destroying 1 vout" );
- vlc_object_release( p_obj ); /* Hmm, is this (thread-)safe?? */
- }
- }
p_playlist->b_cant_sleep = false;
vlc_mutex_unlock( &p_playlist->gc_lock );
}
/* Release the playlist lock, because we may get stuck
* in vlc_object_release() for some time. */
+ printf("_______ releasing\n");
PL_UNLOCK;
vlc_object_release( p_input );
PL_LOCK;
}
}
+/** Get current playing input.
+ */
+input_thread_t * playlist_CurrentInput( playlist_t * p_playlist )
+{
+ input_thread_t * p_input;
+ PL_LOCK;
+ p_input = p_playlist->p_input;
+ if( p_input ) vlc_object_yield( p_input );
+ PL_UNLOCK;
+ return p_input;
+}
+
/**
* @}
*/
void playlist_LastLoop( playlist_t *p_playlist )
{
- vlc_object_t *p_obj;
-
/* If there is an input, kill it */
while( 1 )
{
sout_DeleteInstance( p_sout );
#endif
+ if( p_playlist->status.p_node &&
+ p_playlist->status.p_node->i_flags & PLAYLIST_REMOVE_FLAG )
+ {
+ PL_DEBUG( "%s was marked for deletion, deleting",
+ PLI_NAME( p_playlist->status.p_node ) );
+ playlist_ItemDelete( p_playlist->status.p_node );
+ p_playlist->status.p_node = NULL;
+ }
+ if( p_playlist->status.p_item &&
+ p_playlist->status.p_item->i_flags & PLAYLIST_REMOVE_FLAG )
+ {
+ PL_DEBUG( "%s was marked for deletion, deleting",
+ PLI_NAME( p_playlist->status.p_item ) );
+ playlist_ItemDelete( p_playlist->status.p_item );
+ p_playlist->status.p_item = NULL;
+ }
+
/* Core should have terminated all SDs before the playlist */
/* TODO: It fails to do so when not playing anything -- Courmisch */
playlist_ServicesDiscoveryKillAll( p_playlist );
msleep( (i_activity+1) * 1000 );
vlc_object_lock( p_obj );
}
+
+ for( int i = 0; i < p_obj->i_waiting; i++ )
+ {
+ vlc_gc_decref( p_obj->pp_waiting[i] );
+ REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
+ }
+
vlc_object_unlock( p_obj );
}
msleep( (i_activity+1) * 1000 );
vlc_object_lock( p_obj );
}
+
+ for( int i = 0; i < p_obj->i_waiting; i++ )
+ {
+ vlc_gc_decref( p_obj->pp_waiting[i] );
+ REMOVE_ELEM( p_obj->pp_waiting, p_obj->i_waiting, 0 );
+ }
+
vlc_object_unlock( p_obj );
}
val.i_int = -1;
var_Set( p_playlist, "playlist-current", val );
- var_Create( p_playlist, "intf-popupmenu", VLC_VAR_BOOL );
-
var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "activity", 0 );