Apply ldflags-order part of ldflags_order patch from Alberto Villa.
[melted] / src / modules / jackrack / filter_ladspa.c
index bb71307..7eff6fa 100644 (file)
@@ -18,8 +18,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include "filter_ladspa.h"
-
+#include <framework/mlt_filter.h>
 #include <framework/mlt_frame.h>
 
 #include <stdio.h>
@@ -153,19 +152,21 @@ static void filter_close( mlt_filter this )
        char mlt_name[20];
        mlt_properties properties = MLT_FILTER_PROPERTIES( this );
        
-       for ( i = 0; i < mlt_properties_get_int( properties, "channels" ); i++ )
+       if ( mlt_properties_get_data( properties, "jackrack", NULL ) != NULL )
        {
-               snprintf( mlt_name, sizeof( mlt_name ), "obuf%d", i );
-               mlt_pool_release( mlt_properties_get_data( properties, mlt_name, NULL ) );
-               snprintf( mlt_name, sizeof( mlt_name ), "ibuf%d", i );
-               mlt_pool_release( mlt_properties_get_data( properties, mlt_name, NULL ) );
-       }
-       mlt_pool_release( mlt_properties_get_data( properties, "output_buffers", NULL ) );
-       mlt_pool_release( mlt_properties_get_data( properties, "input_buffers", NULL ) );
-
-       jack_rack_t *jackrack = mlt_properties_get_data( properties, "jackrack", NULL );
-       jack_rack_destroy( jackrack );
+               for ( i = 0; i < mlt_properties_get_int( properties, "channels" ); i++ )
+               {
+                       snprintf( mlt_name, sizeof( mlt_name ), "obuf%d", i );
+                       mlt_pool_release( mlt_properties_get_data( properties, mlt_name, NULL ) );
+                       snprintf( mlt_name, sizeof( mlt_name ), "ibuf%d", i );
+                       mlt_pool_release( mlt_properties_get_data( properties, mlt_name, NULL ) );
+               }
+               mlt_pool_release( mlt_properties_get_data( properties, "output_buffers", NULL ) );
+               mlt_pool_release( mlt_properties_get_data( properties, "input_buffers", NULL ) );
        
+               jack_rack_t *jackrack = mlt_properties_get_data( properties, "jackrack", NULL );
+               jack_rack_destroy( jackrack );
+       }       
        this->parent.close = NULL;
        mlt_service_close( &this->parent );
 }
@@ -173,7 +174,7 @@ static void filter_close( mlt_filter this )
 /** Constructor for the filter.
 */
 
-mlt_filter filter_ladspa_init( char *arg )
+mlt_filter filter_ladspa_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        mlt_filter this = mlt_filter_new( );
        if ( this != NULL )