Commit 29a03bfd authored by Clément Stenac's avatar Clément Stenac

Fix deletion of items when changing them to nodes

parent 6bdb92a0
......@@ -154,13 +154,18 @@ static int Open( vlc_object_t *p_this, int i_type )
0, NULL, -1 );
break;
}
/* TODO FLAGS */
p_sys->p_node_cat = playlist_NodeAddInput( p_playlist, p_sys->p_input,
p_playlist->p_root_category,
PLAYLIST_APPEND, PLAYLIST_END );
p_sys->p_node_one = playlist_NodeAddInput( p_playlist, p_sys->p_input,
p_playlist->p_root_onelevel,
PLAYLIST_APPEND, PLAYLIST_END );
p_sys->p_node_cat->i_flags |= PLAYLIST_RO_FLAG;
p_sys->p_node_cat->i_flags |= PLAYLIST_SKIP_FLAG;
p_sys->p_node_one->i_flags |= PLAYLIST_RO_FLAG;
p_sys->p_node_one->i_flags |= PLAYLIST_SKIP_FLAG;
p_sys->p_node_one->p_input->i_id = p_sys->p_node_cat->p_input->i_id;
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-change", val );
......
......@@ -137,14 +137,16 @@ int playlist_DeleteFromInput( playlist_t *p_playlist, int i_input_id,
p_root->pp_children[i]->p_input->i_id == i_input_id )
{
DeleteInner( p_playlist, p_root->pp_children[i], b_do_stop );
return VLC_SUCCESS;
}
else if( p_root->pp_children[i]->i_children >= 0 )
{
return playlist_DeleteFromInput( p_playlist, i_input_id,
int i_ret = playlist_DeleteFromInput( p_playlist, i_input_id,
p_root->pp_children[i], b_do_stop );
if( i_ret == VLC_SUCCESS ) return VLC_SUCCESS;
}
}
return -1;
return VLC_EGENERIC;
}
/** Remove a playlist item from the playlist, given its id */
......@@ -409,7 +411,7 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
}
else
{
playlist_DeleteFromInput( p_playlist, p_item->p_input->i_id,
playlist_DeleteFromInput( p_playlist, p_item_in_one->p_input->i_id,
p_playlist->p_root_onelevel, VLC_FALSE );
}
var_SetInteger( p_playlist, "item-change", p_item->p_input->i_id );
......@@ -650,9 +652,6 @@ int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
int i_id = p_item->i_id;
vlc_bool_t b_flag = VLC_FALSE;
//fprintf( stderr, "Deleting item %i - %s\n", i_id,
// p_item->p_input->psz_name );
if( p_item->i_children > -1 )
{
return playlist_NodeDelete( p_playlist, p_item, VLC_TRUE, VLC_FALSE );
......
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