[vlc-devel] commit: input: Make sure we send input state changes events. ( Should fix the non sending of a play event reported by Rov Juvano). ( Pierre d'Herbemont )

git version control git at videolan.org
Mon Jun 16 11:45:20 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Mon Jun 16 11:45:05 2008 +0200| [bbc37b53fbf6ad9210de17a8166aa245bbbbef69]

input: Make sure we send input state changes events. (Should fix the non sending of a play event reported by Rov Juvano).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bbc37b53fbf6ad9210de17a8166aa245bbbbef69
---

 src/input/input.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 3b1849d..2421834 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -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 )
             {




More information about the vlc-devel mailing list