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

input: fix changing state

parent de2f058a
......@@ -1731,27 +1731,24 @@ static bool Control( input_thread_t *p_input,
}
case INPUT_CONTROL_SET_STATE:
if( val.i_int != PLAYING_S && val.i_int != PAUSE_S )
msg_Err( p_input, "invalid state in INPUT_CONTROL_SET_STATE" );
else if( p_input->p->i_state == PAUSE_S )
switch( val.i_int )
{
case PLAYING_S:
if( p_input->p->i_state == PAUSE_S )
{
ControlUnpause( p_input, i_control_date );
b_force_update = true;
}
else if( val.i_int == PAUSE_S && p_input->p->i_state == PLAYING_S /* &&
p_input->p->b_can_pause */ )
break;
case PAUSE_S:
if( p_input->p->i_state == PLAYING_S )
{
ControlPause( p_input, i_control_date );
b_force_update = true;
}
else if( val.i_int == PAUSE_S && !p_input->p->b_can_pause && 0 )
{
b_force_update = true;
/* Correct "state" value */
input_ChangeState( p_input, p_input->p->i_state );
break;
default:
msg_Err( p_input, "invalid INPUT_CONTROL_SET_STATE" );
}
break;
......
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