- if( !b_locked ) PL_UNLOCK;
- return VLC_SUCCESS;
-}
-
-/**
- * Add input
- *
- * Add an input item to p_direct_parent in the category tree, and to the
- * matching top category in onelevel
- * \param p_playlist the playlist to add into
- * \param p_input the input item to add
- * \param p_direct_parent the parent item to add into
- * \param i_mode the mode used when adding
- * \param i_pos the position in the playlist where to add. If this is
- * PLAYLIST_END the item will be added at the end of the playlist
- * regardless of its size
- * \param i_cat id of the items category
- * \param i_one id of the item onelevel category
- * \param b_locked TRUE if the playlist is locked
- * \return VLC_SUCCESS if success, VLC_EGENERIC if fail, VLC_ENOMEM if OOM
- */
-int playlist_BothAddInput( playlist_t *p_playlist,
- input_item_t *p_input,
- playlist_item_t *p_direct_parent,
- int i_mode, int i_pos,
- int *i_cat, int *i_one, bool b_locked )
-{
- playlist_item_t *p_item_cat, *p_item_one, *p_up;
- int i_top;
- assert( p_input );
- if( p_playlist->b_die ) return VLC_EGENERIC;
- if( !b_locked ) PL_LOCK;
-
- /* Add to category */
- p_item_cat = playlist_ItemNewFromInput( p_playlist, p_input );
- if( p_item_cat == NULL ) return VLC_ENOMEM;
- AddItem( p_playlist, p_item_cat, p_direct_parent, i_mode, i_pos );
-
- /* Add to onelevel */
- /**Â \todo make a faster case for ml import */
- p_item_one = playlist_ItemNewFromInput( p_playlist, p_input );
- if( p_item_one == NULL ) return VLC_ENOMEM;
-
- p_up = p_direct_parent;
- while( p_up->p_parent != p_playlist->p_root_category )
- {
- p_up = p_up->p_parent;
- }
- for( i_top = 0 ; i_top < p_playlist->p_root_onelevel->i_children; i_top++ )
- {
- if( p_playlist->p_root_onelevel->pp_children[i_top]->p_input->i_id ==
- p_up->p_input->i_id )
- {
- AddItem( p_playlist, p_item_one,
- p_playlist->p_root_onelevel->pp_children[i_top],
- i_mode, i_pos );
- break;
- }
- }
- GoAndPreparse( p_playlist, i_mode, p_item_cat, p_item_one );
+ p_item = playlist_ItemNewFromInput( p_playlist, p_input );
+ if( p_item == NULL ) return VLC_ENOMEM;
+ AddItem( p_playlist, p_item,
+ b_playlist ? p_playlist->p_playing :
+ p_playlist->p_media_library , i_mode, i_pos );