ARRAY_INIT( p_playlist->items );
ARRAY_INIT( p_playlist->all_items );
+ ARRAY_INIT( p_playlist->items_to_delete );
ARRAY_INIT( p_playlist->current );
p_playlist->i_current_index = 0;
return NULL;
/* Create playlist and media library */
+ PL_LOCK; /* playlist_NodesPairCreate will check for it */
playlist_NodesPairCreate( p_playlist, _( "Playlist" ),
&p_playlist->p_local_category,
&p_playlist->p_local_onelevel, false );
+ PL_UNLOCK;
p_playlist->p_local_category->i_flags |= PLAYLIST_RO_FLAG;
p_playlist->p_local_onelevel->i_flags |= PLAYLIST_RO_FLAG;
if( config_GetInt( p_playlist, "media-library") )
{
+ PL_LOCK; /* playlist_NodesPairCreate will check for it */
playlist_NodesPairCreate( p_playlist, _( "Media Library" ),
&p_playlist->p_ml_category,
&p_playlist->p_ml_onelevel, false );
+ PL_UNLOCK;
if(!p_playlist->p_ml_category || !p_playlist->p_ml_onelevel)
return NULL;
return p_input;
}
-
/**
* @}
*/
p_playlist->status.p_item->i_flags & PLAYLIST_REMOVE_FLAG &&
p_playlist->status.p_item != p_item )
{
- PL_DEBUG( "%s was marked for deletion, deleting",
- PLI_NAME( p_playlist->status.p_item ) );
- playlist_ItemDelete( p_playlist->status.p_item );
+ /* It's unsafe given current design to delete a playlist item :(
+ playlist_ItemDelete( p_playlist->status.p_item ); */
}
p_playlist->status.p_item = p_item;
}
p_playlist->status.p_node->i_flags & PLAYLIST_REMOVE_FLAG &&
p_playlist->status.p_node != p_node )
{
- PL_DEBUG( "%s was marked for deletion, deleting",
- PLI_NAME( p_playlist->status.p_node ) );
- playlist_ItemDelete( p_playlist->status.p_node );
+ /* It's unsafe given current design to delete a playlist item :(
+ playlist_ItemDelete( p_playlist->status.p_node ); */
}
p_playlist->status.p_node = p_node;
}
}
ObjectGarbageCollector( p_playlist, true );
return;
- }
- playlist_PlayItem( p_playlist, p_item );
- }
- else
- {
+ }
+ playlist_PlayItem( p_playlist, p_item );
+ }
+ else
+ {
const bool b_gc_forced = p_playlist->status.i_status != PLAYLIST_STOPPED;
p_playlist->status.i_status = PLAYLIST_STOPPED;
free( p_del );
FOREACH_END();
ARRAY_RESET( p_playlist->all_items );
+ FOREACH_ARRAY( playlist_item_t *p_del, p_playlist->items_to_delete )
+ free( p_del->pp_children );
+ vlc_gc_decref( p_del->p_input );
+ free( p_del );
+ FOREACH_END();
+ ARRAY_RESET( p_playlist->items_to_delete );
ARRAY_RESET( p_playlist->items );
ARRAY_RESET( p_playlist->current );