Commit 77a24d6a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

variables: pass VLC_VAR_DELCHOICES parameter by value

parent 84b96054
......@@ -203,7 +203,7 @@ static int OpenPostproc( vlc_object_t *p_this )
var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_SETTEXT, &text );
var_Get( p_filter, FILTER_PREFIX "q", &val_orig );
var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_DELCHOICE, &val_orig );
var_Change( p_filter, FILTER_PREFIX "q", VLC_VAR_DELCHOICE, val_orig );
val.psz_string = var_GetNonEmptyString( p_filter, FILTER_PREFIX "name" );
if( val_orig.i_int )
......
......@@ -322,7 +322,7 @@ static void VarListDel( input_thread_t *p_input,
if( i_value >= 0 )
{
val.i_int = i_value;
var_Change( p_input, psz_variable, VLC_VAR_DELCHOICE, &val );
var_Change( p_input, psz_variable, VLC_VAR_DELCHOICE, val );
}
else
{
......
......@@ -156,7 +156,7 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Get( p_input, "program", &val );
if( val.i_int <= 0 )
var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val );
var_Change( p_input, "program", VLC_VAR_DELCHOICE, val );
text.psz_string = _("Program");
var_Change( p_input, "program", VLC_VAR_SETTEXT, &text );
......
......@@ -495,11 +495,11 @@ int (var_Change)(vlc_object_t *p_this, const char *psz_name, int i_action, ...)
}
case VLC_VAR_DELCHOICE:
{
vlc_value_t *p_val = va_arg(ap, vlc_value_t *);
vlc_value_t val = va_arg(ap, vlc_value_t);
int i;
for( i = 0 ; i < p_var->choices.i_count ; i++ )
if( p_var->ops->pf_cmp( p_var->choices.p_values[i], *p_val ) == 0 )
if( p_var->ops->pf_cmp( p_var->choices.p_values[i], val ) == 0 )
break;
if( i == p_var->choices.i_count )
......@@ -514,7 +514,8 @@ int (var_Change)(vlc_object_t *p_this, const char *psz_name, int i_action, ...)
TAB_ERASE(p_var->choices_text.i_count,
p_var->choices_text.p_values, i);
TriggerListCallback(p_this, p_var, psz_name, VLC_VAR_DELCHOICE, p_val);
TriggerListCallback(p_this, p_var, psz_name, VLC_VAR_DELCHOICE,
&val);
break;
}
case VLC_VAR_CHOICESCOUNT:
......
......@@ -333,7 +333,7 @@ static void test_choices( libvlc_int_t *p_libvlc )
assert( var_CountChoices( p_libvlc, "bla" ) == 2 );
var_Change( p_libvlc, "bla", VLC_VAR_DELCHOICE, &val );
var_Change( p_libvlc, "bla", VLC_VAR_DELCHOICE, val );
assert( var_CountChoices( p_libvlc, "bla" ) == 1 );
var_Change( p_libvlc, "bla", VLC_VAR_GETCHOICES, &val, &val2 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment