Changeset 44de901a6dcdb11f25ab8583738ad0e2ba3c4959
- Timestamp:
- 11/11/07 21:16:51
(1 year ago)
- Author:
- Antoine Cellerier <dionoea@videolan.org>
- git-committer:
- Antoine Cellerier <dionoea@videolan.org> 1194812211 +0000
- git-parent:
[7fe8ad1b31a721f9eebe7df825e7e499ea9a9734]
- git-author:
- Antoine Cellerier <dionoea@videolan.org> 1194812211 +0000
- Message:
Fix module_GetModulesNamesForCapability() and make it handle submodules properly (ie: the shoutcasttv submodule is returned as "shoutcasttv" instead of "shout"). This function (or its services_discovery_GetServicesNames(p_this) specialised version) should be used in interfaces, instead of the current code duplication.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra9143cd |
r44de901 |
|
| 783 | 783 | { |
|---|
| 784 | 784 | vlc_list_t *p_list; |
|---|
| 785 | | int i, count = 0; |
|---|
| | 785 | int i, j, count = 0; |
|---|
| 786 | 786 | char ** psz_ret; |
|---|
| 787 | 787 | |
|---|
| … | … | |
| 795 | 795 | count++; |
|---|
| 796 | 796 | } |
|---|
| 797 | | psz_ret = malloc( sizeof(char**) * (count+1) ); |
|---|
| | 797 | psz_ret = malloc( sizeof(char*) * (count+1) ); |
|---|
| | 798 | j = 0; |
|---|
| 798 | 799 | for( i = 0 ; i < p_list->i_count; i++) |
|---|
| 799 | 800 | { |
|---|
| … | … | |
| 801 | 802 | const char *psz_module_capability = p_module->psz_capability; |
|---|
| 802 | 803 | if( psz_module_capability && !strcmp( psz_module_capability, psz_capability ) ) |
|---|
| 803 | | psz_ret[i] = strdup( p_module->psz_object_name ); |
|---|
| | 804 | { |
|---|
| | 805 | int k = -1; /* hack to handle submodules properly */ |
|---|
| | 806 | if( p_module->b_submodule ) |
|---|
| | 807 | { |
|---|
| | 808 | while( p_module->pp_shortcuts[++k] != NULL ); |
|---|
| | 809 | k--; |
|---|
| | 810 | } |
|---|
| | 811 | psz_ret[j] = strdup( k>=0?p_module->pp_shortcuts[k] |
|---|
| | 812 | :p_module->psz_object_name ); |
|---|
| | 813 | j++; |
|---|
| | 814 | } |
|---|
| 804 | 815 | } |
|---|
| 805 | 816 | psz_ret[count] = NULL; |
|---|
| 806 | 817 | |
|---|
| 807 | 818 | vlc_list_release( p_list ); |
|---|
| 808 | | |
|---|
| | 819 | |
|---|
| 809 | 820 | return psz_ret; |
|---|
| 810 | 821 | } |
|---|