]> git.sesse.net Git - vlc/commitdiff
ncurses: use vlc_list_children
authorRémi Denis-Courmont <rem@videolan.org>
Fri, 16 May 2008 15:41:52 +0000 (18:41 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Fri, 16 May 2008 15:42:21 +0000 (18:42 +0300)
modules/gui/ncurses.c

index 20049e78d62089ab5f2a961b0384cde594635fed..a57df7af058e9adb7be88677053c5ea6d9af6d18 100644 (file)
@@ -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 )
 {
-    vlc_object_yield( p_obj );
-
     if( p_obj->psz_object_name )
         MainBoxWrite( p_intf, (*l)++, 1 + 2 * i_level, "%s \"%s\" (%d)",
                 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
     else
         MainBoxWrite( p_intf, (*l)++, 1 + 2 * i_level, "%s (%d)",
                 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, 
-            i == p_obj->i_children - 1 ? "`-" : "|-" );
-        DumpObject( p_intf, l, p_obj->pp_children[i], i_level + 1 );
+            i == list->i_count - 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 )
@@ -1985,6 +1984,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
     {
         int l = 0;
         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 );
 
         p_sys->i_box_lines_total = l;