* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <vlc/vlc.h>
+#include <assert.h>
#include <vlc/input.h>
#include "vlc_playlist.h"
playlist_item_t *p_parent,
int i_position )
{
- if( !p_parent || p_parent->i_children == -1 )
- {
- msg_Err( p_playlist, "invalid node" );
- return VLC_EGENERIC;
- }
+ assert( p_parent && p_parent->i_children != -1 );
if( i_position == -1 ) i_position = p_parent->i_children ;
INSERT_ELEM( p_parent->pp_children,
p_parent->i_children,
i_position,
p_item );
-
p_item->p_parent = p_parent;
-
return VLC_SUCCESS;
}
p_root->p_input->psz_name );
#endif
- if( !p_root || p_root->i_children == -1 )
- {
- msg_Err( p_playlist,"invalid arguments for GetNextLeaf" );
- return NULL;
- }
+ assert( p_root && p_root->i_children != -1 );
/* Now, walk the tree until we find a suitable next item */
p_next = p_item;
p_root->p_input->psz_name );
#endif
- if( !p_root || p_root->i_children == -1 )
- {
- msg_Err( p_playlist,"invalid arguments for GetNextEnabledLeaf" );
- return NULL;
- }
+ assert( p_root && p_root->i_children != -1 );
/* Now, walk the tree until we find a suitable next item */
p_next = p_item;
msg_Dbg( p_playlist, "finding previous to play within %s",
p_root->p_input->psz_name );
#endif
-
- if( !p_root || p_root->i_children == -1 )
- {
- msg_Err( p_playlist,"invalid arguments for GetPrevLeaf" );
- return NULL;
- }
+ assert( p_root && p_root->i_children != -1 );
/* Now, walk the tree until we find a suitable previous item */
p_prev = p_item;