# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include "variables.h"
#include "libvlc.h"
static vlc_list_t dummy_null_list = {0, NULL, NULL};
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ vlc_refcheck( p_this );
vlc_mutex_lock( &p_priv->var_lock );
/* FIXME: if the variable already exists, we don't duplicate it. But we
variable_t *p_var;
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ vlc_refcheck( p_this );
vlc_mutex_lock( &p_priv->var_lock );
i_var = GetUnused( p_this, psz_name );
vlc_value_t oldval;
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ vlc_refcheck( p_this );
vlc_mutex_lock( &p_priv->var_lock );
i_var = Lookup( p_priv->p_vars, p_priv->i_vars, psz_name );
}
break;
case VLC_VAR_ADDCHOICE:
- /* FIXME: the list is sorted, dude. Use something cleverer. */
- for( i = p_var->choices.i_count ; i-- ; )
- {
- if( p_var->pf_cmp( p_var->choices.p_values[i], *p_val ) < 0 )
- {
- break;
- }
- }
-
- /* The new place is i+1 */
- i++;
-
- if( p_var->i_default >= i )
- {
- p_var->i_default++;
- }
+ i = p_var->choices.i_count;
INSERT_ELEM( p_var->choices.p_values, p_var->choices.i_count,
i, *p_val );
CheckValue( p_var, &p_var->val );
break;
case VLC_VAR_DELCHOICE:
- /* FIXME: the list is sorted, dude. Use something cleverer. */
for( i = 0 ; i < p_var->choices.i_count ; i++ )
{
if( p_var->pf_cmp( p_var->choices.p_values[i], *p_val ) == 0 )
}
break;
+ case VLC_VAR_SETISCOMMAND:
+ p_var->i_type |= VLC_VAR_ISCOMMAND;
+ break;
+
default:
break;
}
vlc_value_t oldval;
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ vlc_refcheck( p_this );
vlc_mutex_lock( &p_priv->var_lock );
i_var = GetUnused( p_this, psz_name );
variable_t *p_var;
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ vlc_refcheck( p_this );
vlc_mutex_lock( &p_priv->var_lock );
i_var = Lookup( p_priv->p_vars, p_priv->i_vars, psz_name );
callback_entry_t entry;
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ vlc_refcheck( p_this );
entry.pf_callback = pf_callback;
entry.p_data = p_data;
variable_t *p_var;
vlc_object_internals_t *p_priv = vlc_internals( p_this );
+ vlc_refcheck( p_this );
vlc_mutex_lock( &p_priv->var_lock );
i_var = GetUnused( p_this, psz_name );
return VLC_ENOOBJ;
}
+ vlc_refcheck( p_this );
i_type = var_Type( p_obj, psz_cmd );
if( !( i_type&VLC_VAR_ISCOMMAND ) )
{