Commit 7aa1522e authored by Thomas Guillem's avatar Thomas Guillem

input: return a status from input_ControlPush

parent e1685d68
......@@ -1412,8 +1412,8 @@ static void End( input_thread_t * p_input )
/*****************************************************************************
* Control
*****************************************************************************/
void input_ControlPush( input_thread_t *p_input,
int i_type, const input_control_param_t *p_param )
int input_ControlPush( input_thread_t *p_input,
int i_type, const input_control_param_t *p_param )
{
input_thread_private_t *sys = input_priv(p_input);
......@@ -1428,6 +1428,8 @@ void input_ControlPush( input_thread_t *p_input,
i_type );
if( p_param )
ControlRelease( i_type, p_param );
vlc_mutex_unlock( &sys->lock_control );
return VLC_EGENERIC;
}
else
{
......@@ -1441,8 +1443,9 @@ void input_ControlPush( input_thread_t *p_input,
sys->control[sys->i_control++] = c;
vlc_cond_signal( &sys->wait_control );
vlc_mutex_unlock( &sys->lock_control );
return VLC_SUCCESS;
}
vlc_mutex_unlock( &sys->lock_control );
}
static size_t ControlGetReducedIndexLocked( input_thread_t *p_input )
......
......@@ -587,30 +587,30 @@ enum input_control_e
/* Internal helpers */
void input_ControlPush( input_thread_t *, int, const input_control_param_t * );
int input_ControlPush( input_thread_t *, int, const input_control_param_t * );
/* XXX for string value you have to allocate it before calling
* input_ControlPushHelper
*/
static inline void input_ControlPushHelper( input_thread_t *p_input, int i_type, vlc_value_t *val )
static inline int input_ControlPushHelper( input_thread_t *p_input, int i_type, vlc_value_t *val )
{
if( val != NULL )
{
input_control_param_t param = { .val = *val };
input_ControlPush( p_input, i_type, &param );
return input_ControlPush( p_input, i_type, &param );
}
else
{
input_ControlPush( p_input, i_type, NULL );
return input_ControlPush( p_input, i_type, NULL );
}
}
static inline void input_ControlPushEsHelper( input_thread_t *p_input, int i_type,
vlc_es_id_t *id )
static inline int input_ControlPushEsHelper( input_thread_t *p_input, int i_type,
vlc_es_id_t *id )
{
assert( i_type == INPUT_CONTROL_SET_ES || i_type == INPUT_CONTROL_UNSET_ES ||
i_type == INPUT_CONTROL_RESTART_ES );
input_ControlPush( p_input, i_type, &(input_control_param_t) {
return input_ControlPush( p_input, i_type, &(input_control_param_t) {
.id = vlc_es_id_Hold( id ),
} );
}
......
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