From 2684aa49bfb80227c6f0402bbb95d03865ed9ad8 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Mon, 31 Mar 2008 00:44:47 +0200 Subject: [PATCH] input: Remove input_ItemClean and input_ItemInit from public land. --- include/vlc_input.h | 51 ------------------------ src/input/input_internal.h | 27 ------------- src/input/item.c | 82 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 78 deletions(-) diff --git a/include/vlc_input.h b/include/vlc_input.h index e3f3dd4bd0..5e03e91906 100644 --- a/include/vlc_input.h +++ b/include/vlc_input.h @@ -162,57 +162,6 @@ int input_ItemAddOption (input_item_t *item, const char *str) return input_ItemAddOpt (item, str, VLC_INPUT_OPTION_TRUSTED); } -static inline void input_ItemClean( input_item_t *p_i ) -{ - int i; - - vlc_event_manager_fini( &p_i->event_manager ); - - free( p_i->psz_name ); - free( p_i->psz_uri ); - if( p_i->p_stats ) - { - vlc_mutex_destroy( &p_i->p_stats->lock ); - free( p_i->p_stats ); - } - - if( p_i->p_meta ) - vlc_meta_Delete( p_i->p_meta ); - - for( i = 0; i < p_i->i_options; i++ ) - free( p_i->ppsz_options[i] ); - TAB_CLEAN( p_i->i_options, p_i->ppsz_options ); - free( p_i->optflagv); - - for( i = 0; i < p_i->i_es; i++ ) - { - es_format_Clean( p_i->es[i] ); - free( p_i->es[i] ); - } - TAB_CLEAN( p_i->i_es, p_i->es ); - - for( i = 0; i < p_i->i_categories; i++ ) - { - info_category_t *p_category = p_i->pp_categories[i]; - int j; - - for( j = 0; j < p_category->i_infos; j++ ) - { - struct info_t *p_info = p_category->pp_infos[j]; - - free( p_info->psz_name); - free( p_info->psz_value ); - free( p_info ); - } - TAB_CLEAN( p_category->i_infos, p_category->pp_infos ); - - free( p_category->psz_name ); - free( p_category ); - } - TAB_CLEAN( p_i->i_categories, p_i->pp_categories ); - - vlc_mutex_destroy( &p_i->lock ); -} VLC_EXPORT( void, input_item_SetMeta, ( input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz_val )); diff --git a/src/input/input_internal.h b/src/input/input_internal.h index 71cac396bc..f60a3146da 100644 --- a/src/input/input_internal.h +++ b/src/input/input_internal.h @@ -220,33 +220,6 @@ static inline void input_ControlPush( input_thread_t *p_input, /** Stuff moved out of vlc_input.h -- FIXME: should probably not be inline * anyway. */ -static inline void input_ItemInit( vlc_object_t *p_o, input_item_t *p_i ) -{ - memset( p_i, 0, sizeof(input_item_t) ); - p_i->psz_name = NULL; - p_i->psz_uri = NULL; - TAB_INIT( p_i->i_es, p_i->es ); - TAB_INIT( p_i->i_options, p_i->ppsz_options ); - p_i->optflagv = NULL, p_i->optflagc = 0; - TAB_INIT( p_i->i_categories, p_i->pp_categories ); - - p_i->i_type = ITEM_TYPE_UNKNOWN; - p_i->b_fixed_name = VLC_TRUE; - - p_i->p_stats = NULL; - p_i->p_meta = NULL; - - vlc_mutex_init( p_o, &p_i->lock ); - vlc_event_manager_init( &p_i->event_manager, p_i, p_o ); - vlc_event_manager_register_event_type( &p_i->event_manager, - vlc_InputItemMetaChanged ); - vlc_event_manager_register_event_type( &p_i->event_manager, - vlc_InputItemSubItemAdded ); - vlc_event_manager_register_event_type( &p_i->event_manager, - vlc_InputItemDurationChanged ); - vlc_event_manager_register_event_type( &p_i->event_manager, - vlc_InputItemPreparsedChanged ); -} static inline void input_item_SetPreparsed( input_item_t *p_i, vlc_bool_t preparsed ) { diff --git a/src/input/item.c b/src/input/item.c index 77ee6e7560..d8b0e7e9af 100644 --- a/src/input/item.c +++ b/src/input/item.c @@ -34,6 +34,88 @@ static void GuessType( input_item_t *p_item ); +/** Stuff moved out of vlc_input.h -- FIXME: should probably not be inline + * anyway. */ +static inline void input_ItemInit( vlc_object_t *p_o, input_item_t *p_i ) +{ + memset( p_i, 0, sizeof(input_item_t) ); + p_i->psz_name = NULL; + p_i->psz_uri = NULL; + TAB_INIT( p_i->i_es, p_i->es ); + TAB_INIT( p_i->i_options, p_i->ppsz_options ); + p_i->optflagv = NULL, p_i->optflagc = 0; + TAB_INIT( p_i->i_categories, p_i->pp_categories ); + + p_i->i_type = ITEM_TYPE_UNKNOWN; + p_i->b_fixed_name = VLC_TRUE; + + p_i->p_stats = NULL; + p_i->p_meta = NULL; + + vlc_mutex_init( p_o, &p_i->lock ); + vlc_event_manager_init( &p_i->event_manager, p_i, p_o ); + vlc_event_manager_register_event_type( &p_i->event_manager, + vlc_InputItemMetaChanged ); + vlc_event_manager_register_event_type( &p_i->event_manager, + vlc_InputItemSubItemAdded ); + vlc_event_manager_register_event_type( &p_i->event_manager, + vlc_InputItemDurationChanged ); + vlc_event_manager_register_event_type( &p_i->event_manager, + vlc_InputItemPreparsedChanged ); +} + +static inline void input_ItemClean( input_item_t *p_i ) +{ + int i; + + vlc_event_manager_fini( &p_i->event_manager ); + + free( p_i->psz_name ); + free( p_i->psz_uri ); + if( p_i->p_stats ) + { + vlc_mutex_destroy( &p_i->p_stats->lock ); + free( p_i->p_stats ); + } + + if( p_i->p_meta ) + vlc_meta_Delete( p_i->p_meta ); + + for( i = 0; i < p_i->i_options; i++ ) + free( p_i->ppsz_options[i] ); + TAB_CLEAN( p_i->i_options, p_i->ppsz_options ); + free( p_i->optflagv); + + for( i = 0; i < p_i->i_es; i++ ) + { + es_format_Clean( p_i->es[i] ); + free( p_i->es[i] ); + } + TAB_CLEAN( p_i->i_es, p_i->es ); + + for( i = 0; i < p_i->i_categories; i++ ) + { + info_category_t *p_category = p_i->pp_categories[i]; + int j; + + for( j = 0; j < p_category->i_infos; j++ ) + { + struct info_t *p_info = p_category->pp_infos[j]; + + free( p_info->psz_name); + free( p_info->psz_value ); + free( p_info ); + } + TAB_CLEAN( p_category->i_infos, p_category->pp_infos ); + + free( p_category->psz_name ); + free( p_category ); + } + TAB_CLEAN( p_i->i_categories, p_i->pp_categories ); + + vlc_mutex_destroy( &p_i->lock ); +} + void input_item_SetMeta( input_item_t *p_i, vlc_meta_type_t meta_type, const char *psz_val ) { vlc_event_t event; -- 2.39.2