[vlc-devel] commit: Join and unload vout safely ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jul 5 14:27:33 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jul  5 15:29:29 2008 +0300| [b9e88f0787500ec44c407379fa963d4925158e91]

Join and unload vout safely

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

 src/video_output/video_output.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index eb56f03..0fe1be3 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -131,6 +131,9 @@ vout_thread_t *__vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
         if( p_vout )
         {
             spu_Attach( p_vout->p_spu, p_this, false );
+            vlc_object_kill( p_vout );
+            vlc_thread_join( p_vout );
+            module_Unneed( p_vout, p_vout->p_module );
             vlc_object_release( p_vout );
         }
         return NULL;
@@ -446,6 +449,9 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
         msg_Err( p_vout, "video output creation failed" );
 
         /* Make sure the thread is destroyed and data released */
+        vlc_object_kill( p_vout );
+        vlc_thread_join( p_vout );
+        module_Unneed( p_vout, p_vout->p_module );
         vlc_object_release( p_vout );
         return NULL;
     }
@@ -462,12 +468,6 @@ static void vout_Destructor( vlc_object_t * p_this )
     vlc_mutex_destroy( &p_vout->change_lock );
     vlc_mutex_destroy( &p_vout->vfilter_lock );
 
-    /* Release the module */
-    if( p_vout->p_module )
-    {
-        module_Unneed( p_vout, p_vout->p_module );
-    }
-
     free( p_vout->psz_filter_chain );
 
     config_ChainDestroy( p_vout->p_cfg );




More information about the vlc-devel mailing list