[vlc-devel] commit: module: Define module_GetMainModule and module_IsMainModule. ( Pierre d'Herbemont )
Antoine Cellerier
dionoea at videolan.org
Sun Jul 6 17:14:13 CEST 2008
On Sat, Jul 05, 2008, git version control wrote:
> +#define module_GetMainModule(a) __module_GetMainModule(VLC_OBJECT(a))
> +static inline module_t * __module_GetMainModule( vlc_object_t * p_this )
> +{
> + module_t * p_module;
> + module_t * p_main_module = NULL;
> + vlc_list_t *p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE,
> + FIND_ANYWHERE );
> + if( !p_list ) return NULL;
> +
> + /* Find the main module */
> + for( int i = 0; i < p_list->i_count; i++ )
> + {
> + p_module = (module_t *)p_list->p_values[i].p_object;
> + if( strcmp( module_GetObjName( p_module ), "main" ) == 0 )
> + {
> + p_main_module = p_module;
> + vlc_object_yield( (vlc_object_t*)p_main_module );
> + break;
> + }
> + }
> + vlc_list_release( p_list );
> + return p_main_module;
> +}
Isn't this the same as vlc_object_find_name( p_this, VLC_OBJECT_MODULE,
"main" ); ?
(Why do you need these functions btw?)
--
Antoine Cellerier
dionoea
More information about the vlc-devel
mailing list