Changeset 30066f7bd1ce28d48032737de40d96bdff516bf4
- Timestamp:
- 05/14/08 20:11:18
(2 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1210788678 +0300
- git-parent:
[ef626a5dee4e9324a14e4f6b20be7cd518bafffe]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1210788678 +0300
- Message:
Recurse through the object tree instead of using the objects table
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rb187d11 |
r30066f7 |
|
| 79 | 79 | static vlc_list_t * NewList ( int ); |
|---|
| 80 | 80 | static void ListReplace ( vlc_list_t *, vlc_object_t *, int ); |
|---|
| 81 | | /*static void ListAppend ( vlc_list_t *, vlc_object_t * );*/ |
|---|
| | 81 | static void ListAppend ( vlc_list_t *, vlc_object_t * ); |
|---|
| 82 | 82 | static int CountChildren ( vlc_object_t *, int ); |
|---|
| 83 | 83 | static void ListChildren ( vlc_list_t *, vlc_object_t *, int ); |
|---|
| … | … | |
| 960 | 960 | } |
|---|
| 961 | 961 | |
|---|
| | 962 | |
|---|
| | 963 | static void vlc_tree_find (vlc_object_t *node, int type, vlc_list_t *list) |
|---|
| | 964 | { |
|---|
| | 965 | assert (node); |
|---|
| | 966 | vlc_assert_locked (&structure_lock); |
|---|
| | 967 | |
|---|
| | 968 | if (node->i_object_type == type) |
|---|
| | 969 | ListAppend (list, node); |
|---|
| | 970 | |
|---|
| | 971 | for (int i = 0; i < node->i_children; i++) |
|---|
| | 972 | vlc_tree_find (node->pp_children[i], type, list); |
|---|
| | 973 | } |
|---|
| | 974 | |
|---|
| 962 | 975 | /** |
|---|
| 963 | 976 | **************************************************************************** |
|---|
| … | … | |
| 970 | 983 | { |
|---|
| 971 | 984 | vlc_list_t *p_list; |
|---|
| 972 | | vlc_object_t **pp_current, **pp_end; |
|---|
| 973 | 985 | int i_count = 0, i_index = 0; |
|---|
| 974 | 986 | libvlc_global_data_t *p_libvlc_global = vlc_global(); |
|---|
| … | … | |
| 980 | 992 | { |
|---|
| 981 | 993 | case FIND_ANYWHERE: |
|---|
| 982 | | pp_current = p_libvlc_global->pp_objects; |
|---|
| 983 | | pp_end = pp_current + p_libvlc_global->i_objects; |
|---|
| 984 | | |
|---|
| 985 | | for( ; pp_current < pp_end ; pp_current++ ) |
|---|
| 986 | | { |
|---|
| 987 | | if( vlc_internals(*pp_current)->b_attached |
|---|
| 988 | | && (*pp_current)->i_object_type == i_type ) |
|---|
| 989 | | { |
|---|
| 990 | | i_count++; |
|---|
| 991 | | } |
|---|
| 992 | | } |
|---|
| 993 | | |
|---|
| 994 | | p_list = NewList( i_count ); |
|---|
| 995 | | pp_current = p_libvlc_global->pp_objects; |
|---|
| 996 | | |
|---|
| 997 | | for( ; pp_current < pp_end ; pp_current++ ) |
|---|
| 998 | | { |
|---|
| 999 | | if( vlc_internals(*pp_current)->b_attached |
|---|
| 1000 | | && (*pp_current)->i_object_type == i_type ) |
|---|
| 1001 | | { |
|---|
| 1002 | | ListReplace( p_list, *pp_current, i_index ); |
|---|
| 1003 | | if( i_index < i_count ) i_index++; |
|---|
| 1004 | | } |
|---|
| 1005 | | } |
|---|
| 1006 | | break; |
|---|
| | 994 | p_list = NewList (0); |
|---|
| | 995 | if (p_list != NULL) |
|---|
| | 996 | vlc_tree_find (VLC_OBJECT (p_libvlc_global), i_type, p_list); |
|---|
| | 997 | break; |
|---|
| 1007 | 998 | |
|---|
| 1008 | 999 | case FIND_CHILD: |
|---|
| … | … | |
| 1571 | 1562 | } |
|---|
| 1572 | 1563 | |
|---|
| 1573 | | /*static void ListAppend( vlc_list_t *p_list, vlc_object_t *p_object ) |
|---|
| | 1564 | static void ListAppend( vlc_list_t *p_list, vlc_object_t *p_object ) |
|---|
| 1574 | 1565 | { |
|---|
| 1575 | 1566 | if( p_list == NULL ) |
|---|
| … | … | |
| 1592 | 1583 | |
|---|
| 1593 | 1584 | return; |
|---|
| 1594 | | }*/ |
|---|
| | 1585 | } |
|---|
| 1595 | 1586 | |
|---|
| 1596 | 1587 | static int CountChildren( vlc_object_t *p_this, int i_type ) |
|---|