Commit 2f05f475 authored by Laurent Aimar's avatar Laurent Aimar

Cosmetics (Error is not used only on error)

parent ea7b923b
......@@ -59,7 +59,7 @@ static int RunAndDestroy ( input_thread_t *p_input );
static input_thread_t * Create ( vlc_object_t *, input_item_t *,
const char *, bool, sout_instance_t * );
static int Init ( input_thread_t *p_input );
static void Error ( input_thread_t *p_input );
static void WaitDie ( input_thread_t *p_input );
static void End ( input_thread_t *p_input );
static void MainLoop( input_thread_t *p_input );
......@@ -494,7 +494,7 @@ static int Run( input_thread_t *p_input )
/* If we failed, wait before we are killed, and exit */
p_input->b_error = true;
Error( p_input );
WaitDie( p_input );
/* Tell we're dead */
p_input->b_dead = true;
......@@ -525,7 +525,7 @@ static int Run( input_thread_t *p_input )
/* Wait until we are asked to die */
if( !p_input->b_die )
{
Error( p_input );
WaitDie( p_input );
}
/* Clean up */
......@@ -1262,13 +1262,13 @@ error:
}
/*****************************************************************************
* Error: RunThread() error loop
* WaitDie: Wait until we are asked to die.
*****************************************************************************
* This function is called when an error occurred during thread main's loop.
*****************************************************************************/
static void Error( input_thread_t *p_input )
static void WaitDie( input_thread_t *p_input )
{
input_ChangeState( p_input, ERROR_S );
input_ChangeState( p_input, p_input->b_error ? ERROR_S : END_S );
while( !p_input->b_die )
{
/* Sleep a while */
......
......@@ -386,13 +386,18 @@ void MRLSplit( char *, const char **, const char **, char ** );
static inline void input_ChangeStateWithVarCallback( input_thread_t *p_input, int state, bool callback )
{
bool changed = (p_input->i_state != state);
const bool changed = p_input->i_state != state;
p_input->i_state = state;
if( callback )
var_SetInteger( p_input, "state", p_input->i_state = state );
{
var_SetInteger( p_input, "state", state );
}
else
{
vlc_value_t val;
p_input->i_state = val.i_int = state;
val.i_int = state;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
}
if( changed )
......
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