]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/panoramix.c
Fixed filters implemented as vout (Init/End can be called multiple times
[vlc] / modules / video_filter / panoramix.c
index 91a067ff603763fa9aa26ec4cb4e918c3b1e45d7..eda2d7f07092737e780aed0b7fa0ccb4450487c9 100644 (file)
@@ -873,15 +873,20 @@ static void End( vout_thread_t *p_vout )
 {
     int i_index;
 
-#ifdef OVERLAP
-    var_SetInteger( p_vout, "bz-length", p_vout->p_sys->bz_length);
-#endif
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     /* Free the fake output buffers we allocated */
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
         free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
     }
+
+    RemoveAllVout( p_vout );
+
+#ifdef OVERLAP
+    var_SetInteger( p_vout, "bz-length", p_vout->p_sys->bz_length);
+#endif
 }
 
 /*****************************************************************************
@@ -893,16 +898,6 @@ static void Destroy( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
-#ifdef GLOBAL_OUTPUT
-    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);
-#endif
-
-    RemoveAllVout( p_vout );
-    DEL_PARENT_CALLBACKS( SendEventsToChild );
-
     free( p_vout->p_sys->pp_vout );
     free( p_vout->p_sys );
 
@@ -1908,10 +1903,7 @@ static void RemoveAllVout( vout_thread_t *p_vout )
              DEL_CALLBACKS(
                  p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout,
                  SendEvents );
-             vlc_object_detach(
-                 p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
-             vlc_object_release(
-                 p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
+             vout_Destroy( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
          }
     }
 }