]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/mosaic.c
Allowed to have access_demux without pf_demux as slave.
[vlc] / modules / video_filter / mosaic.c
index c01810f68712835c689e8ca2a1608f3b9d16d2cc..b9a3928580eb780dc666a9e1a30fe7821917163e 100644 (file)
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_vout.h>
 
 #include <math.h>
 #include <limits.h> /* INT_MAX */
 
-#include "vlc_filter.h"
-#include "vlc_image.h"
+#include <vlc_filter.h>
+#include <vlc_image.h>
 
 #include "mosaic.h"
 
@@ -392,9 +391,27 @@ static void DestroyFilter( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t*)p_this;
     filter_sys_t *p_sys = p_filter->p_sys;
-    int i_index;
 
-    vlc_mutex_lock( &p_sys->lock );
+#define DEL_CB( name ) \
+    var_DelCallback( p_filter, CFG_PREFIX #name, MosaicCallback, p_sys )
+    DEL_CB( width );
+    DEL_CB( height );
+    DEL_CB( xoffset );
+    DEL_CB( yoffset );
+
+    DEL_CB( align );
+
+    DEL_CB( borderw );
+    DEL_CB( borderh );
+    DEL_CB( rows );
+    DEL_CB( cols );
+    DEL_CB( alpha );
+    DEL_CB( position );
+    DEL_CB( delay );
+
+    DEL_CB( keep-aspect-ratio );
+    DEL_CB( order );
+#undef DEL_CB
 
     if( !p_sys->b_keep )
     {
@@ -403,7 +420,7 @@ static void DestroyFilter( vlc_object_t *p_this )
 
     if( p_sys->i_order_length )
     {
-        for( i_index = 0; i_index < p_sys->i_order_length; i_index++ )
+        for( int i_index = 0; i_index < p_sys->i_order_length; i_index++ )
         {
             free( p_sys->ppsz_order[i_index] );
         }
@@ -416,7 +433,6 @@ static void DestroyFilter( vlc_object_t *p_this )
         p_sys->i_offsets_length = 0;
     }
 
-    vlc_mutex_unlock( &p_sys->lock );
     vlc_mutex_destroy( &p_sys->lock );
     free( p_sys );
 }
@@ -654,8 +670,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         {
             msg_Err( p_filter, "cannot allocate SPU region" );
             p_filter->pf_sub_buffer_del( p_filter, p_spu );
-            vlc_mutex_unlock( &p_sys->lock );
             vlc_mutex_unlock( p_sys->p_lock );
+            vlc_mutex_unlock( &p_sys->lock );
             return p_spu;
         }