VLC_API int input_Start( input_thread_t * );
-VLC_API void input_Stop( input_thread_t *, bool b_abort );
+VLC_API void input_Stop( input_thread_t * );
VLC_API int input_Read( vlc_object_t *, input_item_t * );
#define input_Read(a,b) input_Read(VLC_OBJECT(a),b)
* Object lock is NOT held.
* Input lock is held or instance is being destroyed.
*/
-static void release_input_thread( libvlc_media_player_t *p_mi, bool b_input_abort )
+static void release_input_thread( libvlc_media_player_t *p_mi )
{
assert( p_mi );
del_es_callbacks( p_input_thread, p_mi );
/* We owned this one */
- input_Stop( p_input_thread, b_input_abort );
+ input_Stop( p_input_thread );
input_Close( p_input_thread );
}
/* No need for lock_input() because no other threads knows us anymore */
if( p_mi->input.p_thread )
- release_input_thread(p_mi, true);
+ release_input_thread(p_mi);
input_resource_Terminate( p_mi->input.p_resource );
input_resource_Release( p_mi->input.p_resource );
vlc_mutex_destroy( &p_mi->input.lock );
{
lock_input(p_mi);
- /* FIXME I am not sure if it is a user request or on die(eof/error)
- * request here */
- release_input_thread( p_mi,
- p_mi->input.p_thread &&
- !p_mi->input.p_thread->b_eof &&
- !p_mi->input.p_thread->b_error );
+ release_input_thread( p_mi );
lock( p_mi );
set_state( p_mi, libvlc_NothingSpecial, true );
if( libvlc_media_player_can_pause( p_mi ) )
input_Control( p_input_thread, INPUT_SET_STATE, PAUSE_S );
else
- input_Stop( p_input_thread, true );
+ input_Stop( p_input_thread );
}
}
else
libvlc_state_t state = libvlc_media_player_get_state( p_mi );
lock_input(p_mi);
- release_input_thread( p_mi, true ); /* This will stop the input thread */
+ release_input_thread( p_mi ); /* This will stop the input thread */
/* Force to go to stopped state, in case we were in Ended, or Error
* state. */
fingerprinter_sys_t *p_sys = ( fingerprinter_sys_t * ) p_arg;
if ( p_sys->p_input )
{
- input_Stop( p_sys->p_input, true );
+ input_Stop( p_sys->p_input );
input_Close( p_sys->p_input );
}
/* cleanup temporary result */
}
var_DelCallback( p_sys->p_input, "intf-event", inputStateCallback, p_sys );
}
- input_Stop( p_sys->p_input, true );
+ input_Stop( p_sys->p_input );
input_Close( p_sys->p_input );
p_sys->p_input = NULL;
if( !p_input )
continue;
- input_Stop( p_input, true );
+ input_Stop( p_input );
input_Close( p_input );
p_sd->p_sys->pp_input[i] = NULL;
if( p_input->b_eof || p_input->b_error )
{
- input_Stop( p_input, false );
+ input_Stop( p_input );
input_Close( p_input );
p_sd->p_sys->pp_input[i] = NULL;
/**
* Request a running input thread to stop and die
*
- * b_abort must be true when a user stop is requested and not because you have
- * detected an error or an eof. It will be used to properly send the
- * INPUT_EVENT_ABORT event.
- *
* \param p_input the input thread to stop
- * \param b_abort true if the input has been aborted by a user request
*/
-void input_Stop( input_thread_t *p_input, bool b_abort )
+void input_Stop( input_thread_t *p_input )
{
/* Set die for input and ALL of this childrens (even (grand-)grand-childrens)
* It is needed here even if it is done in INPUT_CONTROL_SET_DIE handler to
* unlock the control loop */
ObjectKillChildrens( VLC_OBJECT(p_input) );
-
- vlc_mutex_lock( &p_input->p->lock_control );
- p_input->p->b_abort |= b_abort;
- vlc_mutex_unlock( &p_input->p->lock_control );
-
input_ControlPush( p_input, INPUT_CONTROL_SET_DIE, NULL );
}
vlc_mutex_init( &p_input->p->lock_control );
vlc_cond_init( &p_input->p->wait_control );
p_input->p->i_control = 0;
- p_input->p->b_abort = false;
p_input->p->is_running = false;
/* Create Object Variables for private use only */
int i_control;
input_control_t control[INPUT_CONTROL_FIFO_SIZE];
- bool b_abort;
bool is_running;
vlc_thread_t thread;
};
var_DelCallback( p_input, "intf-event", InputEventPreparse,
&preparse );
- input_Stop( p_input, true );
+ input_Stop( p_input );
input_Close( p_input );
vlc_sem_destroy( &sem_preparse );
}
input_thread_t *p_input = p_instance->p_input;
if( p_input )
{
- input_Stop( p_input, true );
+ input_Stop( p_input );
input_Join( p_input );
var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
input_Release( p_input );
}
- input_Stop( p_input, true );
+ input_Stop( p_input );
input_Join( p_input );
var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media );
input_Release( p_input );
sys->request.i_skip = 0;
sys->request.p_item = p_item;
if( sys->p_input != NULL )
- input_Stop( sys->p_input, true );
+ input_Stop( sys->p_input );
vlc_cond_signal( &sys->signal );
}
/* Preparse if no artist/album info, and hasn't been preparsed allready
if( p_sys->request.b_request || p_sys->killed )
{
PL_DEBUG( "incoming request - stopping current input" );
- input_Stop( p_input, true );
+ input_Stop( p_input );
}
#warning Unsynchronized access to *p_input flags...
else if( p_input->b_error || p_input->b_eof )
{
PL_DEBUG( "finished input" );
- input_Stop( p_input, false );
+ input_Stop( p_input );
}
vlc_cond_wait( &p_sys->signal, &p_sys->lock );