[vlc-devel] commit: ncurses: use vlc_list_children ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri May 16 17:41:20 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Fri May 16 18:41:52 2008 +0300| [414624cea784dc0c97bb99826bad98b3c95fda36]

ncurses: use vlc_list_children

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=414624cea784dc0c97bb99826bad98b3c95fda36
---

 modules/gui/ncurses.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 20049e7..a57df7a 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -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;




More information about the vlc-devel mailing list