Commit e86b51d0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Depth is the word

parent bf3e69e2
...@@ -47,9 +47,9 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_with_root_index( i ...@@ -47,9 +47,9 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_with_root_index( i
} }
/************************************************************************** /**************************************************************************
* path_deepness (Media List Player Internal) * path_depth (Media List Player Internal)
**************************************************************************/ **************************************************************************/
static inline int libvlc_media_list_path_deepness( libvlc_media_list_path_t path ) static inline int libvlc_media_list_path_depth( libvlc_media_list_path_t path )
{ {
int i; int i;
for( i = 0; path[i] != -1; i++ ); for( i = 0; path[i] != -1; i++ );
...@@ -61,10 +61,10 @@ static inline int libvlc_media_list_path_deepness( libvlc_media_list_path_t path ...@@ -61,10 +61,10 @@ static inline int libvlc_media_list_path_deepness( libvlc_media_list_path_t path
**************************************************************************/ **************************************************************************/
static inline void libvlc_media_list_path_append( libvlc_media_list_path_t * p_path, int index ) static inline void libvlc_media_list_path_append( libvlc_media_list_path_t * p_path, int index )
{ {
int old_deepness = libvlc_media_list_path_deepness( *p_path ); int old_depth = libvlc_media_list_path_depth( *p_path );
*p_path = realloc( *p_path, sizeof(int)*(old_deepness+2)); *p_path = realloc( *p_path, sizeof(int)*(old_depth+2));
*p_path[old_deepness] = index; *p_path[old_depth] = index;
*p_path[old_deepness+1] = -1; *p_path[old_depth+1] = -1;
} }
/************************************************************************** /**************************************************************************
...@@ -73,11 +73,11 @@ static inline void libvlc_media_list_path_append( libvlc_media_list_path_t * p_p ...@@ -73,11 +73,11 @@ static inline void libvlc_media_list_path_append( libvlc_media_list_path_t * p_p
static inline libvlc_media_list_path_t libvlc_media_list_path_copy_by_appending( libvlc_media_list_path_t path, int index ) static inline libvlc_media_list_path_t libvlc_media_list_path_copy_by_appending( libvlc_media_list_path_t path, int index )
{ {
libvlc_media_list_path_t ret; libvlc_media_list_path_t ret;
int old_deepness = libvlc_media_list_path_deepness( path ); int old_depth = libvlc_media_list_path_depth( path );
ret = malloc( sizeof(int)*(old_deepness+2) ); ret = malloc( sizeof(int)*(old_depth+2) );
memcpy( ret, path, sizeof(int)*(old_deepness+2) ); memcpy( ret, path, sizeof(int)*(old_depth+2) );
ret[old_deepness] = index; ret[old_depth] = index;
ret[old_deepness+1] = -1; ret[old_depth+1] = -1;
return ret; return ret;
} }
...@@ -87,9 +87,9 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_copy_by_appending( ...@@ -87,9 +87,9 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_copy_by_appending(
static inline libvlc_media_list_path_t libvlc_media_list_path_copy( libvlc_media_list_path_t path ) static inline libvlc_media_list_path_t libvlc_media_list_path_copy( libvlc_media_list_path_t path )
{ {
libvlc_media_list_path_t ret; libvlc_media_list_path_t ret;
int deepness = libvlc_media_list_path_deepness( path ); int depth = libvlc_media_list_path_depth( path );
ret = malloc( sizeof(int)*(deepness+1) ); ret = malloc( sizeof(int)*(depth+1) );
memcpy( ret, path, sizeof(int)*(deepness+1) ); memcpy( ret, path, sizeof(int)*(depth+1) );
return ret; return ret;
} }
......
...@@ -64,23 +64,23 @@ get_next_path( libvlc_media_list_player_t * p_mlp ) ...@@ -64,23 +64,23 @@ get_next_path( libvlc_media_list_player_t * p_mlp )
p_mlp->p_mlist, p_mlp->p_mlist,
p_mlp->current_playing_item_path ); p_mlp->current_playing_item_path );
int deepness = libvlc_media_list_path_deepness( p_mlp->current_playing_item_path ); int depth = libvlc_media_list_path_depth( p_mlp->current_playing_item_path );
if( deepness < 1 || !p_parent_of_playing_item ) if( depth < 1 || !p_parent_of_playing_item )
return NULL; return NULL;
ret = libvlc_media_list_path_copy( p_mlp->current_playing_item_path ); ret = libvlc_media_list_path_copy( p_mlp->current_playing_item_path );
while( ret[deepness-1] >= libvlc_media_list_count( p_parent_of_playing_item, NULL ) ) while( ret[depth-1] >= libvlc_media_list_count( p_parent_of_playing_item, NULL ) )
{ {
deepness--; depth--;
if( deepness <= 0 ) if( depth <= 0 )
{ {
free( ret ); free( ret );
libvlc_media_list_release( p_parent_of_playing_item ); libvlc_media_list_release( p_parent_of_playing_item );
return NULL; return NULL;
} }
ret[deepness] = -1; ret[depth] = -1;
ret[deepness-1]++; ret[depth-1]++;
p_parent_of_playing_item = libvlc_media_list_parentlist_at_path( p_parent_of_playing_item = libvlc_media_list_parentlist_at_path(
p_mlp->p_mlist, p_mlp->p_mlist,
ret ); ret );
......
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