[vlc-commits] vlm : call var_DelCallback after input thread is joined.

Sébastien Escudier git at videolan.org
Tue May 31 13:21:13 CEST 2011


vlc | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Wed May 25 14:16:36 2011 +0200| [04058ca6feb89a9f813f578cd9a4f45812c7361d] | committer: Sébastien Escudier

vlm : call var_DelCallback after input thread is joined.
This reverts vlm callback behaviour before 67b16b1b9f1babba51ca186a5a1107156f897c09

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04058ca6feb89a9f813f578cd9a4f45812c7361d
---

 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 8f64c25..266a0ce 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 5d384ef..efe6b8e 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 3df530e..66dfbf7 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 );



More information about the vlc-commits mailing list