vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Thu Feb 5 22:40:42 2015 +0200| [acb7470b524fa4f46ede85025323b9204d3f358d] | committer: Rémi Denis-Courmont
input: remove useless parameter to input_Stop() > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=acb7470b524fa4f46ede85025323b9204d3f358d --- include/vlc_input.h | 2 +- lib/media_player.c | 17 ++++++----------- modules/misc/fingerprinter.c | 4 ++-- modules/services_discovery/podcast.c | 4 ++-- src/input/input.c | 13 +------------ src/input/input_internal.h | 1 - src/input/vlm.c | 6 +++--- src/playlist/item.c | 2 +- src/playlist/thread.c | 4 ++-- 9 files changed, 18 insertions(+), 35 deletions(-) diff --git a/include/vlc_input.h b/include/vlc_input.h index cdcfdd0..b1eb11e 100644 --- a/include/vlc_input.h +++ b/include/vlc_input.h @@ -494,7 +494,7 @@ VLC_API input_thread_t * input_CreateAndStart( vlc_object_t *p_parent, input_ite 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) diff --git a/lib/media_player.c b/lib/media_player.c index 81762ad..e36567e 100644 --- a/lib/media_player.c +++ b/lib/media_player.c @@ -124,7 +124,7 @@ static inline void unlock_input(libvlc_media_player_t *mp) * 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 ); @@ -144,7 +144,7 @@ static void release_input_thread( libvlc_media_player_t *p_mi, bool b_input_abor 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 ); } @@ -685,7 +685,7 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi ) /* 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 ); @@ -742,12 +742,7 @@ void libvlc_media_player_set_media( { 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 ); @@ -899,7 +894,7 @@ void libvlc_media_player_set_pause( libvlc_media_player_t *p_mi, int paused ) 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 @@ -941,7 +936,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi ) 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. */ diff --git a/modules/misc/fingerprinter.c b/modules/misc/fingerprinter.c index 21e9f1e..6c2ced3 100644 --- a/modules/misc/fingerprinter.c +++ b/modules/misc/fingerprinter.c @@ -143,7 +143,7 @@ static void cancelDoFingerprint( void *p_arg ) 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 */ @@ -217,7 +217,7 @@ static void DoFingerprint( vlc_object_t *p_this, fingerprinter_sys_t *p_sys, aco } 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; diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c index d3064f2..7e25ca0 100644 --- a/modules/services_discovery/podcast.c +++ b/modules/services_discovery/podcast.c @@ -186,7 +186,7 @@ static void Close( vlc_object_t *p_this ) 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; @@ -237,7 +237,7 @@ static void *Run( void *data ) 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; diff --git a/src/input/input.c b/src/input/input.c index 7e6a12d..8c81e67 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -235,24 +235,14 @@ int input_Start( input_thread_t *p_input ) /** * 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 ); } @@ -397,7 +387,6 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, 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 */ diff --git a/src/input/input_internal.h b/src/input/input_internal.h index 71762ad..fa8c2b1 100644 --- a/src/input/input_internal.h +++ b/src/input/input_internal.h @@ -161,7 +161,6 @@ struct input_thread_private_t int i_control; input_control_t control[INPUT_CONTROL_FIFO_SIZE]; - bool b_abort; bool is_running; vlc_thread_t thread; }; diff --git a/src/input/vlm.c b/src/input/vlm.c index 5c78179..0f57768 100644 --- a/src/input/vlm.c +++ b/src/input/vlm.c @@ -662,7 +662,7 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media ) 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 ); } @@ -904,7 +904,7 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc 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 ); @@ -996,7 +996,7 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char * } - 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 ); diff --git a/src/playlist/item.c b/src/playlist/item.c index a05b776..5ce59f3 100644 --- a/src/playlist/item.c +++ b/src/playlist/item.c @@ -755,7 +755,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode, 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 diff --git a/src/playlist/thread.c b/src/playlist/thread.c index 62085d9..b865af8 100644 --- a/src/playlist/thread.c +++ b/src/playlist/thread.c @@ -438,7 +438,7 @@ static void LoopInput( playlist_t *p_playlist ) 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... @@ -466,7 +466,7 @@ static void LoopInput( playlist_t *p_playlist ) 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 ); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
