Hide it before someone thinks (s)he can use it without locking libvlc.
global_stats_t *p_stats; ///< Global statistics
global_stats_t *p_stats; ///< Global statistics
- /* There is no real reason to keep a list of items, but not to break
- * everything, let's keep it */
- input_item_array_t input_items; ///< Array of all created input items
- int i_last_input_id ; ///< Last id of input item
/* Structure storing the action name / key associations */
struct hotkey
/* Structure storing the action name / key associations */
struct hotkey
static void input_ItemDestroy ( gc_object_t *p_this )
{
vlc_object_t *p_obj = (vlc_object_t *)p_this->p_destructor_arg;
static void input_ItemDestroy ( gc_object_t *p_this )
{
vlc_object_t *p_obj = (vlc_object_t *)p_this->p_destructor_arg;
+ libvlc_priv_t *priv = libvlc_priv (p_obj->p_libvlc);
input_item_t *p_input = (input_item_t *) p_this;
int i;
input_item_t *p_input = (input_item_t *) p_this;
int i;
vlc_mutex_lock( &p_obj->p_libvlc->object_lock );
vlc_mutex_lock( &p_obj->p_libvlc->object_lock );
- ARRAY_BSEARCH( p_obj->p_libvlc->input_items,->i_id, int, p_input->i_id, i);
+ ARRAY_BSEARCH( priv->input_items,->i_id, int, p_input->i_id, i);
- ARRAY_REMOVE( p_obj->p_libvlc->input_items, i);
+ ARRAY_REMOVE( priv->input_items, i);
vlc_mutex_unlock( &p_obj->p_libvlc->object_lock );
vlc_mutex_unlock( &p_obj->p_libvlc->object_lock );
input_item_t *__input_ItemGetById( vlc_object_t *p_obj, int i_id )
{
input_item_t *__input_ItemGetById( vlc_object_t *p_obj, int i_id )
{
+ libvlc_priv_t *priv = libvlc_priv (p_obj->p_libvlc);
input_item_t * p_ret = NULL;
int i;
vlc_mutex_lock( &p_obj->p_libvlc->object_lock );
input_item_t * p_ret = NULL;
int i;
vlc_mutex_lock( &p_obj->p_libvlc->object_lock );
- ARRAY_BSEARCH( p_obj->p_libvlc->input_items, ->i_id, int, i_id, i);
+ ARRAY_BSEARCH( priv->input_items, ->i_id, int, i_id, i);
- p_ret = ARRAY_VAL( p_obj->p_libvlc->input_items, i);
+ p_ret = ARRAY_VAL( priv->input_items, i);
vlc_mutex_unlock( &p_obj->p_libvlc->object_lock );
vlc_mutex_unlock( &p_obj->p_libvlc->object_lock );
mtime_t i_duration,
int i_type )
{
mtime_t i_duration,
int i_type )
{
+ libvlc_priv_t *priv = libvlc_priv (p_obj->p_libvlc);
+
DECMALLOC_NULL( p_input, input_item_t );
input_ItemInit( p_obj, p_input );
vlc_gc_init( p_input, input_ItemDestroy, (void *)p_obj );
vlc_mutex_lock( &p_obj->p_libvlc->object_lock );
DECMALLOC_NULL( p_input, input_item_t );
input_ItemInit( p_obj, p_input );
vlc_gc_init( p_input, input_ItemDestroy, (void *)p_obj );
vlc_mutex_lock( &p_obj->p_libvlc->object_lock );
- p_input->i_id = ++p_obj->p_libvlc->i_last_input_id;
- ARRAY_APPEND( p_obj->p_libvlc->input_items, p_input );
+ p_input->i_id = ++priv->i_last_input_id;
+ ARRAY_APPEND( priv->input_items, p_input );
vlc_mutex_unlock( &p_obj->p_libvlc->object_lock );
p_input->b_fixed_name = false;
vlc_mutex_unlock( &p_obj->p_libvlc->object_lock );
p_input->b_fixed_name = false;
priv->p_stats_computer = NULL;
/* Init the array that holds every input item */
priv->p_stats_computer = NULL;
/* Init the array that holds every input item */
- ARRAY_INIT( p_libvlc->input_items );
- p_libvlc->i_last_input_id = 0;
+ ARRAY_INIT( priv->input_items );
+ priv->i_last_input_id = 0;
/*
* Initialize hotkey handling
/*
* Initialize hotkey handling
#endif
bool b_clean = true;
#endif
bool b_clean = true;
- FOREACH_ARRAY( input_item_t *p_del, p_libvlc->input_items )
+ FOREACH_ARRAY( input_item_t *p_del, priv->input_items )
msg_Err( p_libvlc, "input item %p has not been deleted properly: refcount %d, name %s",
p_del, p_del->i_gc_refcount, p_del->psz_name ? p_del->psz_name : "(null)" );
b_clean = false;
FOREACH_END();
assert( b_clean );
msg_Err( p_libvlc, "input item %p has not been deleted properly: refcount %d, name %s",
p_del, p_del->i_gc_refcount, p_del->psz_name ? p_del->psz_name : "(null)" );
b_clean = false;
FOREACH_END();
assert( b_clean );
- ARRAY_RESET( p_libvlc->input_items );
+ ARRAY_RESET( priv->input_items );
msg_Dbg( p_libvlc, "removing stats" );
vlc_mutex_destroy( &p_libvlc->p_stats->lock );
msg_Dbg( p_libvlc, "removing stats" );
vlc_mutex_destroy( &p_libvlc->p_stats->lock );
vlc_mutex_t config_lock; ///< config file lock
char * psz_configfile; ///< location of config file
vlc_mutex_t config_lock; ///< config file lock
char * psz_configfile; ///< location of config file
+ /* There is no real reason to keep a list of items, but not to break
+ * everything, let's keep it */
+ input_item_array_t input_items; ///< Array of all created input items
+ int i_last_input_id ; ///< Last id of input item
+
/* Messages */
msg_bank_t msg_bank; ///< The message bank
int i_verbose; ///< info messages
/* Messages */
msg_bank_t msg_bank; ///< The message bank
int i_verbose; ///< info messages