Commit c7cd0ac4 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

input: Attempt to fix variables deadlocks.

parent c351872b
......@@ -1550,7 +1550,7 @@ static bool Control( input_thread_t *p_input, int i_type,
b_force_update = true;
/* Switch to play */
input_ChangeState( p_input, PLAYING_S);
input_ChangeStateWithVarCallback( p_input, PLAYING_S, false );
/* */
if( !i_ret )
......@@ -1580,7 +1580,7 @@ static bool Control( input_thread_t *p_input, int i_type,
}
/* Switch to new state */
input_ChangeState( p_input, state);
input_ChangeStateWithVarCallback( p_input, state, false );
/* */
if( !i_ret )
......@@ -1591,7 +1591,7 @@ static bool Control( input_thread_t *p_input, int i_type,
b_force_update = true;
/* Correct "state" value */
input_ChangeState( p_input, p_input->i_state );
input_ChangeStateWithVarCallback( p_input, p_input->i_state, false );
}
else if( val.i_int != PLAYING_S && val.i_int != PAUSE_S )
{
......
......@@ -384,10 +384,17 @@ int subtitles_Filter( const char *);
void MRLSplit( char *, const char **, const char **, char ** );
static inline void input_ChangeState( input_thread_t *p_input, int state )
static inline void input_ChangeStateWithVarCallback( input_thread_t *p_input, int state, bool callback )
{
bool changed = (p_input->i_state != state);
var_SetInteger( p_input, "state", p_input->i_state = state );
if( callback )
var_SetInteger( p_input, "state", p_input->i_state = state );
else
{
vlc_value_t val;
val.i_int = PLAYING_S;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
}
if( changed )
{
vlc_event_t event;
......@@ -397,6 +404,12 @@ static inline void input_ChangeState( input_thread_t *p_input, int state )
}
}
static inline void input_ChangeState( input_thread_t *p_input, int state )
{
input_ChangeStateWithVarCallback( p_input, state, true );
}
/* Access */
#define access_New( a, b, c, d ) __access_New(VLC_OBJECT(a), b, c, d )
......
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