Commit abc84401 authored by Jakob Leben's avatar Jakob Leben

playlist: consistently change input item type when subitems are added

parent dfebdb6a
......@@ -254,10 +254,6 @@ static void post_subitems( input_item_node_t *p_node )
* the input item children. */
void input_item_PostSubItem( input_item_t *p_parent, input_item_t *p_child )
{
vlc_mutex_lock( &p_parent->lock );
p_parent->i_type = ITEM_TYPE_PLAYLIST;
vlc_mutex_unlock( &p_parent->lock );
input_item_node_t *p_node = input_item_node_Create( p_parent );
input_item_node_AppendItem( p_node, p_child );
input_item_node_PostAndDelete( p_node );
......
......@@ -755,8 +755,16 @@ static void AddItem( playlist_t *p_playlist, playlist_item_t *p_item,
static void ChangeToNode( playlist_t *p_playlist, playlist_item_t *p_item )
{
int i;
if( p_item->i_children == -1 )
p_item->i_children = 0;
if( p_item->i_children != -1 ) return;
p_item->i_children = 0;
input_item_t *p_input = p_item->p_input;
vlc_mutex_lock( &p_input->lock );
p_input->i_type = ITEM_TYPE_NODE;
vlc_mutex_unlock( &p_input->lock );
var_SetAddress( p_playlist, "item-change", p_item->p_input );
/* Remove it from the array of available items */
ARRAY_BSEARCH( p_playlist->items,->i_id, int, p_item->i_id, i );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment