From 04058ca6feb89a9f813f578cd9a4f45812c7361d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Escudier?= Date: Wed, 25 May 2011 14:16:36 +0200 Subject: [PATCH] vlm : call var_DelCallback after input thread is joined. This reverts vlm callback behaviour before 67b16b1b9f1babba51ca186a5a1107156f897c09 --- include/vlc_input.h | 2 ++ src/input/input.c | 16 +++++++++++++--- src/input/vlm.c | 6 ++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/vlc_input.h b/include/vlc_input.h index 8f64c25fc3..266a0ce066 100644 --- a/include/vlc_input.h +++ b/include/vlc_input.h @@ -544,6 +544,8 @@ VLC_API int input_vaControl( input_thread_t *, int i_query, va_list ); VLC_API int input_Control( input_thread_t *, int i_query, ... ); VLC_API void input_Close( input_thread_t * ); +void input_Join( input_thread_t * ); +void input_Release( input_thread_t * ); /** * Get the input item for an input thread diff --git a/src/input/input.c b/src/input/input.c index 5d384efce2..efe6b8ed6f 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -252,6 +252,17 @@ void input_Stop( input_thread_t *p_input, bool b_abort ) input_ControlPush( p_input, INPUT_CONTROL_SET_DIE, NULL ); } +void input_Join( input_thread_t *p_input ) +{ + if( p_input->p->is_running ) + vlc_join( p_input->p->thread, NULL ); +} + +void input_Release( input_thread_t *p_input ) +{ + vlc_object_release( p_input ); +} + /** * Close an input * @@ -259,9 +270,8 @@ void input_Stop( input_thread_t *p_input, bool b_abort ) */ void input_Close( input_thread_t *p_input ) { - if( p_input->p->is_running ) - vlc_join( p_input->p->thread, NULL ); - vlc_object_release( p_input ); + input_Join( p_input ); + input_Release( p_input ); } /** diff --git a/src/input/vlm.c b/src/input/vlm.c index 3df530e772..66dfbf7bf8 100644 --- a/src/input/vlm.c +++ b/src/input/vlm.c @@ -912,8 +912,9 @@ static void vlm_MediaInstanceDelete( vlm_t *p_vlm, int64_t id, vlm_media_instanc if( p_input ) { input_Stop( p_input, true ); + input_Join( p_input ); var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media ); - input_Close( p_input ); + input_Release( p_input ); vlm_SendEventMediaInstanceStopped( p_vlm, id, p_media->cfg.psz_name ); } @@ -1006,8 +1007,9 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char * input_Stop( p_input, true ); + input_Join( p_input ); var_DelCallback( p_instance->p_input, "intf-event", InputEvent, p_media ); - input_Close( p_input ); + input_Release( p_input ); if( !p_instance->b_sout_keep ) input_resource_TerminateSout( p_instance->p_input_resource ); -- GitLab