if( !p_input )
p_new_input = input_ItemNewWithType( VLC_OBJECT(p_playlist), NULL,
psz_name, 0, NULL, -1, ITEM_TYPE_NODE );
- p_item = playlist_ItemNewFromInput( VLC_OBJECT(p_playlist),
+ p_item = playlist_ItemNewFromInput( p_playlist,
p_input ? p_input : p_new_input );
if( p_new_input )
vlc_gc_decref( p_new_input );
int playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root,
bool b_delete_items )
{
+ PL_ASSERT_LOCKED;
int i;
if( p_root->i_children == -1 )
{
int playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
bool b_delete_items, bool b_force )
{
+ PL_ASSERT_LOCKED;
int i;
if( p_root->i_children == -1 )
if( p_root->p_parent )
playlist_NodeRemoveItem( p_playlist, p_root, p_root->p_parent );
- /* Check if it is the current node */
- if( p_playlist->status.p_node == p_root )
- {
- /* Hack we don't call playlist_Control for lock reasons */
- p_playlist->request.i_status = PLAYLIST_STOPPED;
- p_playlist->request.b_request = true;
- p_playlist->request.p_item = NULL;
- p_playlist->request.p_node = NULL;
- msg_Info( p_playlist, "stopping playback" );
- vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
-
- PL_DEBUG( "marking %s for further deletion", PLI_NAME( p_root ) );
- p_root->i_flags |= PLAYLIST_REMOVE_FLAG;
- }
- else
- playlist_ItemDelete( p_root );
-
-
+ playlist_ItemRelease( p_root );
}
return VLC_SUCCESS;
}
playlist_item_t *p_parent,
int i_position )
{
+ PL_ASSERT_LOCKED;
(void)p_playlist;
assert( p_parent && p_parent->i_children != -1 );
if( i_position == -1 ) i_position = p_parent->i_children ;
playlist_item_t *p_item,
playlist_item_t *p_parent )
{
+ PL_ASSERT_LOCKED;
(void)p_playlist;
for(int i= 0; i< p_parent->i_children ; i++ )
*/
int playlist_NodeChildrenCount( playlist_t *p_playlist, playlist_item_t*p_node)
{
+ PL_ASSERT_LOCKED;
int i;
int i_nb = 0;
playlist_item_t *playlist_ChildSearchName( playlist_item_t *p_node,
const char *psz_search )
{
+ playlist_t * p_playlist = p_node->p_playlist; /* For assert_locked */
+ PL_ASSERT_LOCKED;
int i;
if( p_node->i_children < 0 )
playlist_item_t **pp_node_one,
bool b_for_sd )
{
+ PL_ASSERT_LOCKED;
*pp_node_cat = playlist_NodeCreate( p_playlist, psz_name,
p_playlist->p_root_category, 0, NULL );
*pp_node_one = playlist_NodeCreate( p_playlist, psz_name,
playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
playlist_item_t *p_node )
{
+ PL_ASSERT_LOCKED;
int i;
if( p_node->p_parent == p_playlist->p_root_category )
{
playlist_item_t *playlist_GetLastLeaf(playlist_t *p_playlist,
playlist_item_t *p_root )
{
+ PL_ASSERT_LOCKED;
int i;
playlist_item_t *p_item;
for ( i = p_root->i_children - 1; i >= 0; i-- )
return NULL;
}
-int playlist_GetAllEnabledChildren( playlist_t *p_playlist,
- playlist_item_t *p_node,
- playlist_item_t ***ppp_items )
-{
- int i_count = 0;
- playlist_item_t *p_next = NULL;
- while( 1 )
- {
- p_next = playlist_GetNextLeaf( p_playlist, p_node,
- p_next, true, false );
- if( p_next )
- INSERT_ELEM( *ppp_items, i_count, i_count, p_next );
- else
- break;
- }
- return i_count;
-}
-
/**
* Finds the next item to play
*
playlist_item_t *p_item,
bool b_ena, bool b_unplayed )
{
+ PL_ASSERT_LOCKED;
playlist_item_t *p_next;
assert( p_root && p_root->i_children != -1 );
playlist_item_t *p_item,
bool b_ena, bool b_unplayed )
{
+ PL_ASSERT_LOCKED;
playlist_item_t *p_prev;
PL_DEBUG2( "finding previous os %s within %s", PLI_NAME( p_item ),