Commit 343195f1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

variables: pass VLC_VAR_SETVALUE parameter by value

parent 6df71108
......@@ -390,7 +390,7 @@ static vlc_v4l2_ctrl_t *ControlAddInteger (vlc_object_t *obj, int fd,
msg_Dbg (obj, " current: %3"PRId32", default: %3"PRId32,
ctrl.value, query->default_value);
val.i_int = ctrl.value;
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
var_Change(obj, c->name, VLC_VAR_SETVALUE, val);
}
var_Change (obj, c->name, VLC_VAR_SETMINMAX,
(vlc_value_t){ .i_int = query->minimum },
......@@ -429,7 +429,7 @@ static vlc_v4l2_ctrl_t *ControlAddBoolean (vlc_object_t *obj, int fd,
ctrl.value ? " true" : "false",
query->default_value ? " true" : "false");
val.b_bool = ctrl.value;
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
var_Change(obj, c->name, VLC_VAR_SETVALUE, val);
}
return c;
}
......@@ -459,7 +459,7 @@ static vlc_v4l2_ctrl_t *ControlAddMenu (vlc_object_t *obj, int fd,
msg_Dbg (obj, " current: %"PRId32", default: %"PRId32,
ctrl.value, query->default_value);
val.i_int = ctrl.value;
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
var_Change(obj, c->name, VLC_VAR_SETVALUE, val);
}
var_Change (obj, c->name, VLC_VAR_SETMINMAX,
(vlc_value_t){ .i_int = query->minimum },
......@@ -532,7 +532,7 @@ static vlc_v4l2_ctrl_t *ControlAddInteger64 (vlc_object_t *obj, int fd,
vlc_value_t val = { .i_int = ext_ctrl.value64 };
msg_Dbg (obj, " current: %"PRId64, val.i_int);
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
var_Change(obj, c->name, VLC_VAR_SETVALUE, val);
}
return c;
......@@ -584,7 +584,7 @@ static vlc_v4l2_ctrl_t *ControlAddString (vlc_object_t *obj, int fd,
vlc_value_t val = { .psz_string = buf };
msg_Dbg (obj, " current: \"%s\"", buf);
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
var_Change(obj, c->name, VLC_VAR_SETVALUE, val);
}
free (buf);
}
......@@ -617,7 +617,7 @@ static vlc_v4l2_ctrl_t *ControlAddBitMask (vlc_object_t *obj, int fd,
msg_Dbg (obj, " current: 0x%08"PRIX32", default: 0x%08"PRIX32,
ctrl.value, query->default_value);
val.i_int = ctrl.value;
var_Change(obj, c->name, VLC_VAR_SETVALUE, &val);
var_Change(obj, c->name, VLC_VAR_SETVALUE, val);
}
var_Change (obj, c->name, VLC_VAR_SETMINMAX,
(vlc_value_t){ .i_int = 0 },
......
......@@ -229,7 +229,7 @@ void ThemeRepository::updateRepository()
}
// mark this current skins as 'checked' in list
var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, &val );
var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, val );
free( psz_current );
}
......
......@@ -520,7 +520,7 @@ static void aout_PrepareStereoMode (audio_output_t *aout,
}
var_Change(aout, "stereo-mode", VLC_VAR_SETVALUE,
&(vlc_value_t) { .i_int = i_output_mode });
(vlc_value_t) { .i_int = i_output_mode });
}
/**
......
......@@ -60,11 +60,11 @@ void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_
/* */
val.f_float = f_position;
var_Change( p_input, "position", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "position", VLC_VAR_SETVALUE, val );
/* */
val.i_int = i_time;
var_Change( p_input, "time", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "time", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_POSITION );
}
......@@ -79,7 +79,7 @@ void input_SendEventLength( input_thread_t *p_input, mtime_t i_length )
input_item_SetDuration( input_priv(p_input)->p_item, i_length );
val.i_int = i_length;
var_Change( p_input, "length", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "length", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_LENGTH );
}
......@@ -92,7 +92,7 @@ void input_SendEventRate( input_thread_t *p_input, int i_rate )
vlc_value_t val;
val.f_float = (float)INPUT_RATE_DEFAULT / (float)i_rate;
var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "rate", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_RATE );
}
......@@ -101,7 +101,7 @@ void input_SendEventAudioDelay( input_thread_t *p_input, mtime_t i_delay )
vlc_value_t val;
val.i_int = i_delay;
var_Change( p_input, "audio-delay", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "audio-delay", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_AUDIO_DELAY );
}
......@@ -111,7 +111,7 @@ void input_SendEventSubtitleDelay( input_thread_t *p_input, mtime_t i_delay )
vlc_value_t val;
val.i_int = i_delay;
var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_SUBTITLE_DELAY );
}
......@@ -122,7 +122,7 @@ void input_SendEventRecord( input_thread_t *p_input, bool b_recording )
vlc_value_t val;
val.b_bool = b_recording;
var_Change( p_input, "record", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "record", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_RECORD );
}
......@@ -132,7 +132,7 @@ void input_SendEventTitle( input_thread_t *p_input, int i_title )
vlc_value_t val;
val.i_int = i_title;
var_Change( p_input, "title", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "title", VLC_VAR_SETVALUE, val );
input_ControlVarTitle( p_input, i_title );
......@@ -145,12 +145,12 @@ void input_SendEventSeekpoint( input_thread_t *p_input, int i_title, int i_seekp
/* "chapter" */
val.i_int = i_seekpoint;
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, val );
/* "title %2u" */
char psz_title[sizeof ("title ") + 3 * sizeof (int)];
sprintf( psz_title, "title %2u", i_title );
var_Change( p_input, psz_title, VLC_VAR_SETVALUE, &val );
var_Change( p_input, psz_title, VLC_VAR_SETVALUE, val );
/* */
Trigger( p_input, INPUT_EVENT_CHAPTER );
......@@ -161,10 +161,10 @@ void input_SendEventSignal( input_thread_t *p_input, double f_quality, double f_
vlc_value_t val;
val.f_float = f_quality;
var_Change( p_input, "signal-quality", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "signal-quality", VLC_VAR_SETVALUE, val );
val.f_float = f_strength;
var_Change( p_input, "signal-strength", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "signal-strength", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_SIGNAL );
}
......@@ -174,7 +174,7 @@ void input_SendEventState( input_thread_t *p_input, int i_state )
vlc_value_t val;
val.i_int = i_state;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "state", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_STATE );
}
......@@ -184,7 +184,7 @@ void input_SendEventCache( input_thread_t *p_input, double f_level )
vlc_value_t val;
val.f_float = f_level;
var_Change( p_input, "cache", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "cache", VLC_VAR_SETVALUE, val );
Trigger( p_input, INPUT_EVENT_CACHE );
}
......@@ -338,7 +338,7 @@ static void VarListSelect( input_thread_t *p_input,
vlc_value_t val;
val.i_int = i_value;
var_Change( p_input, psz_variable, VLC_VAR_SETVALUE, &val );
var_Change( p_input, psz_variable, VLC_VAR_SETVALUE, val );
Trigger( p_input, i_event );
}
......
......@@ -1701,7 +1701,7 @@ static void ViewpointApply( input_thread_t *p_input )
var_SetAddress( pp_vout[i], "viewpoint", &priv->viewpoint );
/* This variable can only be read from callbacks */
var_Change( pp_vout[i], "viewpoint", VLC_VAR_SETVALUE,
&(vlc_value_t) { .p_address = NULL } );
(vlc_value_t) { .p_address = NULL } );
vlc_object_release( pp_vout[i] );
}
free( pp_vout );
......@@ -1713,7 +1713,7 @@ static void ViewpointApply( input_thread_t *p_input )
var_SetAddress( p_aout, "viewpoint", &priv->viewpoint );
/* This variable can only be read from callbacks */
var_Change( p_aout, "viewpoint", VLC_VAR_SETVALUE,
&(vlc_value_t) { .p_address = NULL } );
(vlc_value_t) { .p_address = NULL } );
vlc_object_release( p_aout );
}
}
......
......@@ -133,7 +133,7 @@ void input_ControlVarInit ( input_thread_t *p_input )
/* State */
var_Create( p_input, "state", VLC_VAR_INTEGER );
val.i_int = input_priv(p_input)->i_state;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "state", VLC_VAR_SETVALUE, val );
/* Rate */
var_Create( p_input, "rate", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
......@@ -184,19 +184,19 @@ void input_ControlVarInit ( input_thread_t *p_input )
val.i_int = -1;
/* Video ES */
var_Create( p_input, "video-es", VLC_VAR_INTEGER );
var_Change( p_input, "video-es", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "video-es", VLC_VAR_SETVALUE, val );
text.psz_string = _("Video Track");
var_Change( p_input, "video-es", VLC_VAR_SETTEXT, &text );
/* Audio ES */
var_Create( p_input, "audio-es", VLC_VAR_INTEGER );
var_Change( p_input, "audio-es", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "audio-es", VLC_VAR_SETVALUE, val );
text.psz_string = _("Audio Track");
var_Change( p_input, "audio-es", VLC_VAR_SETTEXT, &text );
/* Spu ES */
var_Create( p_input, "spu-es", VLC_VAR_INTEGER );
var_Change( p_input, "spu-es", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "spu-es", VLC_VAR_SETVALUE, val );
text.psz_string = _("Subtitle Track");
var_Change( p_input, "spu-es", VLC_VAR_SETTEXT, &text );
......@@ -599,7 +599,7 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t val;
val.i_int = i_length * newval.f_float;
var_Change( p_input, "time", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "time", VLC_VAR_SETVALUE, val );
}
input_ControlPush( p_input, INPUT_CONTROL_SET_POSITION, &newval );
......@@ -619,7 +619,7 @@ static int TimeCallback( vlc_object_t *p_this, char const *psz_cmd,
vlc_value_t val;
val.f_float = (double)newval.i_int/(double)i_length;
var_Change( p_input, "position", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "position", VLC_VAR_SETVALUE, val );
/*
* Notify the intf that a new event has been occurred.
* XXX this is a bit hackish but it's the only way to do it now.
......@@ -671,7 +671,7 @@ static int TitleCallback( vlc_object_t *p_this, char const *psz_cmd,
val.i_int = var_GetInteger( p_input, "title" ) + 1;
var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &count );
if( (size_t)val.i_int < count )
var_Change( p_input, "title", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "title", VLC_VAR_SETVALUE, val );
}
else if( !strcmp( psz_cmd, "prev-title" ) )
{
......@@ -679,7 +679,7 @@ static int TitleCallback( vlc_object_t *p_this, char const *psz_cmd,
val.i_int = var_GetInteger( p_input, "title" ) - 1;
if( val.i_int >= 0 )
var_Change( p_input, "title", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "title", VLC_VAR_SETVALUE, val );
}
else if( !strcmp( psz_cmd, "menu-title" ) )
{
......@@ -713,7 +713,7 @@ static int SeekpointCallback( vlc_object_t *p_this, char const *psz_cmd,
val.i_int = var_GetInteger( p_input, "chapter" ) + 1;
var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &count );
if( (size_t)val.i_int < count )
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, val );
}
else if( !strcmp( psz_cmd, "prev-chapter" ) )
{
......@@ -721,7 +721,7 @@ static int SeekpointCallback( vlc_object_t *p_this, char const *psz_cmd,
val.i_int = var_GetInteger( p_input, "chapter" ) - 1;
if( val.i_int >= 0 )
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, val );
}
else
{
......@@ -743,12 +743,12 @@ static int NavigationCallback( vlc_object_t *p_this, char const *psz_cmd,
val.i_int = (intptr_t)p_data;
input_ControlPush( p_input, INPUT_CONTROL_SET_TITLE, &val );
var_Change( p_input, "title", VLC_VAR_SETVALUE, &val );
var_Change( p_input, "title", VLC_VAR_SETVALUE, val );
/* And a chapter change */
input_ControlPush( p_input, INPUT_CONTROL_SET_SEEKPOINT, &newval );
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, &newval );
var_Change( p_input, "chapter", VLC_VAR_SETVALUE, newval );
return VLC_SUCCESS;
}
......
......@@ -538,7 +538,7 @@ int (var_Change)(vlc_object_t *p_this, const char *psz_name, int i_action, ...)
break;
case VLC_VAR_SETVALUE:
/* Duplicate data if needed */
newval = *va_arg(ap, vlc_value_t *);
newval = va_arg(ap, vlc_value_t);
p_var->ops->pf_dup( &newval );
/* Backup needed stuff */
oldval = p_var->val;
......
......@@ -156,9 +156,9 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
/* */
val.psz_string = deinterlace_mode ? deinterlace_mode : optm->orig.psz;
var_Change(vout, "deinterlace-mode", VLC_VAR_SETVALUE, &val);
var_Change(vout, "deinterlace-mode", VLC_VAR_SETVALUE, val);
val.b_bool = is_interlaced;
var_Change(vout, "deinterlace-needed", VLC_VAR_SETVALUE, &val);
var_Change(vout, "deinterlace-needed", VLC_VAR_SETVALUE, val);
var_SetInteger(vout, "deinterlace", deinterlace_state);
free(deinterlace_mode);
......
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