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

ncurses: use vlc_list_children

parent 8bd54617
...@@ -1482,8 +1482,6 @@ static void MainBoxWrite( intf_thread_t *p_intf, int l, int x, const char *p_fmt ...@@ -1482,8 +1482,6 @@ static void MainBoxWrite( intf_thread_t *p_intf, int l, int x, const char *p_fmt
static void DumpObject( intf_thread_t *p_intf, int *l, vlc_object_t *p_obj, int i_level ) static void DumpObject( intf_thread_t *p_intf, int *l, vlc_object_t *p_obj, int i_level )
{ {
vlc_object_yield( p_obj );
if( p_obj->psz_object_name ) if( p_obj->psz_object_name )
MainBoxWrite( p_intf, (*l)++, 1 + 2 * i_level, "%s \"%s\" (%d)", MainBoxWrite( p_intf, (*l)++, 1 + 2 * i_level, "%s \"%s\" (%d)",
p_obj->psz_object_type, p_obj->psz_object_name, p_obj->psz_object_type, p_obj->psz_object_name,
...@@ -1491,15 +1489,16 @@ static void DumpObject( intf_thread_t *p_intf, int *l, vlc_object_t *p_obj, int ...@@ -1491,15 +1489,16 @@ static void DumpObject( intf_thread_t *p_intf, int *l, vlc_object_t *p_obj, int
else else
MainBoxWrite( p_intf, (*l)++, 1 + 2 * i_level, "%s (%d)", MainBoxWrite( p_intf, (*l)++, 1 + 2 * i_level, "%s (%d)",
p_obj->psz_object_type, p_obj->i_object_id ); p_obj->psz_object_type, p_obj->i_object_id );
int i;
for( i = 0; i < p_obj->i_children ; i++ ) vlc_list_t *list = vlc_list_children( p_obj );
vlc_object_release( p_obj );
for( int i = 0; i < list->i_count ; i++ )
{ {
MainBoxWrite( p_intf, *l, 1 + 2 * i_level, MainBoxWrite( p_intf, *l, 1 + 2 * i_level,
i == p_obj->i_children - 1 ? "`-" : "|-" ); i == list->i_count - 1 ? "`-" : "|-" );
DumpObject( p_intf, l, p_obj->pp_children[i], i_level + 1 ); DumpObject( p_intf, l, list->p_values[i].p_object, i_level + 1 );
} }
vlc_object_release( p_obj );
} }
static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh ) static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
...@@ -1985,6 +1984,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh ) ...@@ -1985,6 +1984,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
{ {
int l = 0; int l = 0;
DrawBox( p_sys->w, y++, 0, h, COLS, _(" Objects "), p_sys->b_color ); DrawBox( p_sys->w, y++, 0, h, COLS, _(" Objects "), p_sys->b_color );
vlc_object_yield( p_intf->p_libvlc );
DumpObject( p_intf, &l, VLC_OBJECT( p_intf->p_libvlc ), 0 ); DumpObject( p_intf, &l, VLC_OBJECT( p_intf->p_libvlc ), 0 );
p_sys->i_box_lines_total = l; p_sys->i_box_lines_total = l;
......
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