]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/opencv_wrapper.c
Fixed filters implemented as vout (Init/End can be called multiple times
[vlc] / modules / video_filter / opencv_wrapper.c
index 24f1be84067548b44874bc431189aa9587c85b3b..b38e215c61ec821d04ed47fe52f7bf7709b6c161 100644 (file)
@@ -374,6 +374,10 @@ static void End( vout_thread_t *p_vout )
 {
     int i_index;
 
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
+    DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
+
     /* Free the fake output buffers we allocated */
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
@@ -391,6 +395,7 @@ static void End( vout_thread_t *p_vout )
         p_vout->p_sys->p_opencv = NULL;
     }
 
+    vout_Destroy( p_vout->p_sys->p_vout )
 }
 
 /*****************************************************************************
@@ -402,15 +407,6 @@ static void Destroy( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
-    if( p_vout->p_sys->p_vout )
-    {
-        DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
-        vlc_object_detach( p_vout->p_sys->p_vout );
-        vlc_object_release( p_vout->p_sys->p_vout );
-    }
-
-    DEL_PARENT_CALLBACKS( SendEventsToChild );
-
     ReleaseImages(p_vout);
 
     if( p_vout->p_sys->p_image )