]> git.sesse.net Git - vlc/commitdiff
input: Make sure we send input state changes events. (Should fix the non sending...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 16 Jun 2008 09:45:05 +0000 (11:45 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 16 Jun 2008 09:47:09 +0000 (11:47 +0200)
src/input/input.c

index 3b1849de9ec13f40a48383becc6dde41397c4fa5..2421834cc27fb7df83da29bec950b46a19dddf47 100644 (file)
@@ -1550,9 +1550,7 @@ static bool Control( input_thread_t *p_input, int i_type,
                 b_force_update = true;
 
                 /* Switch to play */
-                p_input->i_state = PLAYING_S;
-                val.i_int = PLAYING_S;
-                var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
+                input_ChangeState( p_input, PLAYING_S);
 
                 /* */
                 if( !i_ret )
@@ -1561,7 +1559,7 @@ static bool Control( input_thread_t *p_input, int i_type,
             else if( val.i_int == PAUSE_S && p_input->i_state == PLAYING_S &&
                      p_input->p->b_can_pause )
             {
-                int i_ret;
+                int i_ret, state;
                 if( p_input->p->input.p_access )
                     i_ret = access_Control( p_input->p->input.p_access,
                                              ACCESS_SET_PAUSE_STATE, true );
@@ -1574,16 +1572,15 @@ static bool Control( input_thread_t *p_input, int i_type,
                 if( i_ret )
                 {
                     msg_Warn( p_input, "cannot set pause state" );
-                    val.i_int = p_input->i_state;
+                    state = p_input->i_state;
                 }
                 else
                 {
-                    val.i_int = PAUSE_S;
+                    state = PAUSE_S;
                 }
 
                 /* Switch to new state */
-                p_input->i_state = val.i_int;
-                var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
+                input_ChangeState( p_input, state);
 
                 /* */
                 if( !i_ret )
@@ -1594,8 +1591,7 @@ static bool Control( input_thread_t *p_input, int i_type,
                 b_force_update = true;
 
                 /* Correct "state" value */
-                val.i_int = p_input->i_state;
-                var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
+                input_ChangeState( p_input, p_input->i_state );
             }
             else if( val.i_int != PLAYING_S && val.i_int != PAUSE_S )
             {