input_DetachSout corrections
authorSébastien Escudier <sebastien-devel@celeos.eu>
Tue, 4 Nov 2008 15:12:58 +0000 (16:12 +0100)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 4 Nov 2008 15:57:27 +0000 (17:57 +0200)
Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
src/input/input.c
src/input/vlm.c

index a147b2e..4f37c84 100644 (file)
@@ -490,6 +490,7 @@ void input_StopThread( input_thread_t *p_input )
 
 sout_instance_t * input_DetachSout( input_thread_t *p_input )
 {
+    assert( p_input->b_dead );
     sout_instance_t *p_sout = p_input->p->p_sout;
     vlc_object_detach( p_sout );
     p_input->p->p_sout = NULL;
index ed265a1..42a7036 100644 (file)
@@ -768,8 +768,8 @@ static void vlm_MediaInstanceDelete( vlm_media_instance_sys_t *p_instance )
     if( p_input )
     {
         input_StopThread( p_input );
-        p_instance->p_sout = input_DetachSout( p_input );
         vlc_thread_join( p_input );
+        p_instance->p_sout = input_DetachSout( p_input );
         vlc_object_release( p_input );
     }
     if( p_instance->p_sout )
@@ -846,8 +846,8 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
         }
 
         input_StopThread( p_input );
-        p_instance->p_sout = input_DetachSout( p_input );
         vlc_thread_join( p_input );
+        p_instance->p_sout = input_DetachSout( p_input );
         vlc_object_release( p_input );
         if( !p_instance->b_sout_keep && p_instance->p_sout )
         {