]> git.sesse.net Git - mlt/commitdiff
westley/libxml2 mods, mcdv/mpeg release integration
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 5 Feb 2004 12:27:01 +0000 (12:27 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 5 Feb 2004 12:27:01 +0000 (12:27 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@114 d19143bc-622f-0410-bfdd-b5b2a6649095

14 files changed:
docs/services.txt
setenv
src/framework/mlt_frame.c
src/framework/mlt_multitrack.c
src/framework/mlt_producer.c
src/framework/mlt_transition.c
src/miracle/miracle_unit.c
src/modules/dv/producer_libdv.c
src/modules/ffmpeg/consumer_ffmpeg.c
src/modules/ffmpeg/producer_ffmpeg.c
src/modules/resample/filter_resample.c
src/modules/sdl/consumer_sdl.c
src/modules/westley/consumer_westley.c
src/modules/westley/producer_westley.c

index 3a442f62a58a24e59b269cdad0872c8e0da3f22f..27864d3d79c4ed879af01daf5724e5f359c8163b 100644 (file)
@@ -43,8 +43,6 @@ Producers
                        Audio sync discrepancy with some content.
                        Not all libavformat supported formats are seekable.
                        ogg is currently broken.
-                       Multiple mp3 uses in a single instance causes crash (patch
-                       available on request - submitted to ffmpeg mailing list).
                        mpeg seeking is inaccurate - doesn't seek to i-frames so you may
                        get junk for a few frames.
 
@@ -478,6 +476,35 @@ Filters
 
                        none
                
+       obscure
+       
+               Description
+
+                       Obscuring filter.
+                       
+               Constructor Argument
+
+                       none
+                       
+               Initialisation Properties
+               
+                       string start - in the format X,Y:WxH[:PWxPY]
+                       string end - in the format X,Y:WxH[:PWxPY]
+                       int in - in point
+                       int out - out point
+
+               Read Only Properties
+
+                       none
+                       
+               Dependencies
+
+                       none
+
+               Known Bugs
+
+                       none
+
        resize
        
                Description
diff --git a/setenv b/setenv
index 809cb1c43c9093d368c2bdd9f06acfeba0efb06b..fe41a89a277f7b2ac78e91cb0478ccc140e3790c 100644 (file)
--- a/setenv
+++ b/setenv
@@ -9,8 +9,8 @@ export LD_LIBRARY_PATH=\
 `pwd`/src/miracle:\
 `pwd`/src/modules/bluefish:\
 `pwd`/../bluefish/lib:\
-`pwd`/../mpeg_sdk_demo/bin:\
-`pwd`/../dv_sdk
+`pwd`/../mpeg_sdk_release/bin:\
+`pwd`/../dv_sdk_release
 
 export PATH=\
 `pwd`/src/albino:\
index 880cdef4395fa3b61bb9f52daea727ecb209320f..b576aeb9568ae25d9664e967c2c0684de710d2a9 100644 (file)
@@ -53,7 +53,7 @@ mlt_frame mlt_frame_init( )
                mlt_properties_init( properties, this );
 
                // Set default properties on the frame
-               mlt_properties_set_position( properties, "position", 0.0 );
+               mlt_properties_set_position( properties, "_position", 0.0 );
                mlt_properties_set_data( properties, "image", NULL, 0, NULL, NULL );
                mlt_properties_set_int( properties, "width", 720 );
                mlt_properties_set_int( properties, "height", 576 );
@@ -109,7 +109,7 @@ int mlt_frame_set_aspect_ratio( mlt_frame this, double value )
 
 mlt_position mlt_frame_get_position( mlt_frame this )
 {
-       return mlt_properties_get_position( mlt_frame_properties( this ), "position" );
+       return mlt_properties_get_position( mlt_frame_properties( this ), "_position" );
 }
 
 /** Set the position of this frame.
@@ -117,7 +117,7 @@ mlt_position mlt_frame_get_position( mlt_frame this )
 
 int mlt_frame_set_position( mlt_frame this, mlt_position value )
 {
-       return mlt_properties_set_position( mlt_frame_properties( this ), "position", value );
+       return mlt_properties_set_position( mlt_frame_properties( this ), "_position", value );
 }
 
 /** Stack a get_image callback.
@@ -721,7 +721,7 @@ int mlt_frame_mix_audio( mlt_frame this, mlt_frame that, float weight, int16_t *
        double d = 0, s = 0;
 
        mlt_frame_get_audio( this, &p_dest, format, &frequency_dest, &channels_dest, &samples_dest );
-       //fprintf( stderr, "frame dest samples %d channels %d position %lld\n", samples_dest, channels_dest, mlt_properties_get_position( mlt_frame_properties( this ), "position" ) );
+       //fprintf( stderr, "frame dest samples %d channels %d position %lld\n", samples_dest, channels_dest, mlt_properties_get_position( mlt_frame_properties( this ), "_position" ) );
        mlt_frame_get_audio( that, &p_src, format, &frequency_src, &channels_src, &samples_src );
        //fprintf( stderr, "frame src  samples %d channels %d\n", samples_src, channels_src );
        src = p_src;
index ef7a1bed65732feaa505924ba47978dc32fc73fb..c9ea81ce6c820ac1a2fe5b3be1bd1f3297d22300 100644 (file)
@@ -371,9 +371,9 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int ind
 
                // Indicate speed of this producer
                mlt_properties producer_properties = mlt_producer_properties( parent );
-               double speed = mlt_properties_get_double( producer_properties, "speed" );
+               double speed = mlt_properties_get_double( producer_properties, "_speed" );
                mlt_properties properties = mlt_frame_properties( *frame );
-               mlt_properties_set_double( properties, "speed", speed );
+               mlt_properties_set_double( properties, "_speed", speed );
        }
        else
        {
index 2a5b60e7ad7aa9066160fca2933225d39d8435be..1921783ab88f64d4ac71680668d83365f1cf2722 100644 (file)
@@ -59,10 +59,10 @@ int mlt_producer_init( mlt_producer this, void *child )
        
                        // Set the default properties
                        mlt_properties_set( properties, "mlt_type", "mlt_producer" );
-                       mlt_properties_set_position( properties, "position", 0.0 );
-                       mlt_properties_set_double( properties, "frame", 0 );
+                       mlt_properties_set_position( properties, "_position", 0.0 );
+                       mlt_properties_set_double( properties, "_frame", 0 );
                        mlt_properties_set_double( properties, "fps", 25.0 );
-                       mlt_properties_set_double( properties, "speed", 1.0 );
+                       mlt_properties_set_double( properties, "_speed", 1.0 );
                        mlt_properties_set_position( properties, "in", 0 );
                        mlt_properties_set_position( properties, "out", 1799999 );
                        mlt_properties_set_position( properties, "length", 1800000 );
@@ -109,10 +109,10 @@ int mlt_producer_seek( mlt_producer this, mlt_position position )
                position = mlt_producer_get_playtime( this ) - 1;
 
        // Set the position
-       mlt_properties_set_position( mlt_producer_properties( this ), "position", position );
+       mlt_properties_set_position( mlt_producer_properties( this ), "_position", position );
 
        // Calculate the absolute frame
-       mlt_properties_set_position( mlt_producer_properties( this ), "frame", mlt_producer_get_in( this ) + position );
+       mlt_properties_set_position( mlt_producer_properties( this ), "_frame", mlt_producer_get_in( this ) + position );
 
        return 0;
 }
@@ -122,7 +122,7 @@ int mlt_producer_seek( mlt_producer this, mlt_position position )
 
 mlt_position mlt_producer_position( mlt_producer this )
 {
-       return mlt_properties_get_position( mlt_producer_properties( this ), "position" );
+       return mlt_properties_get_position( mlt_producer_properties( this ), "_position" );
 }
 
 /** Get the current position (relative to start of producer).
@@ -130,7 +130,7 @@ mlt_position mlt_producer_position( mlt_producer this )
 
 mlt_position mlt_producer_frame( mlt_producer this )
 {
-       return mlt_properties_get_position( mlt_producer_properties( this ), "frame" );
+       return mlt_properties_get_position( mlt_producer_properties( this ), "_frame" );
 }
 
 /** Set the playing speed.
@@ -138,7 +138,7 @@ mlt_position mlt_producer_frame( mlt_producer this )
 
 int mlt_producer_set_speed( mlt_producer this, double speed )
 {
-       return mlt_properties_set_double( mlt_producer_properties( this ), "speed", speed );
+       return mlt_properties_set_double( mlt_producer_properties( this ), "_speed", speed );
 }
 
 /** Get the playing speed.
@@ -146,7 +146,7 @@ int mlt_producer_set_speed( mlt_producer this, double speed )
 
 double mlt_producer_get_speed( mlt_producer this )
 {
-       return mlt_properties_get_double( mlt_producer_properties( this ), "speed" );
+       return mlt_properties_get_double( mlt_producer_properties( this ), "_speed" );
 }
 
 /** Get the frames per second.
@@ -261,7 +261,7 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind
        mlt_properties properties = mlt_frame_properties( *frame );
        mlt_properties_set_double( properties, "fps", mlt_producer_get_fps( this ) );
        double speed = mlt_producer_get_speed( this );
-       mlt_properties_set_double( properties, "speed", speed );
+       mlt_properties_set_double( properties, "_speed", speed );
 
        return 0;
 }
index 9eb0c46d9df571e7dc24035d359df2ec82af41b3..10d2aeeeeea16ec52eb2f5e2304731c4a21c7488 100644 (file)
@@ -170,7 +170,6 @@ static int transition_get_frame( mlt_service service, mlt_frame_ptr frame, int i
        mlt_position in = mlt_properties_get_position( properties, "in" );
        mlt_position out = mlt_properties_get_position( properties, "out" );
 
-       // Fetch a and b frames together...
        if ( ( index == a_track || index == b_track ) && !( this->a_held || this->b_held ) )
        {
                mlt_service_get_frame( this->producer, &this->a_frame, a_track );
index b10179b2e4218eb75bf46f7214bbff2a91729d77..0469ae51a0debe9b6eb901a1631d5f6fa45e0290 100644 (file)
@@ -127,10 +127,59 @@ void miracle_unit_set_notifier( miracle_unit this, valerie_notifier notifier, ch
        miracle_unit_status_communicate( this );
 }
 
+static mlt_producer create_producer( char *file )
+{
+       mlt_producer result = NULL;
+
+       // 1st Line preferences
+       if ( strstr( file, ".inigo" ) )
+               result = mlt_factory_producer( "inigo_file", file );
+       else if ( strstr( file, ".westley" ) )
+               result = mlt_factory_producer( "westley", file );
+       else if ( strstr( file, ".mpg" ) )
+               result = mlt_factory_producer( "mcmpeg", file );
+       else if ( strstr( file, ".mpeg" ) )
+               result = mlt_factory_producer( "mcmpeg", file );
+       else if ( strstr( file, ".dv" ) )
+               result = mlt_factory_producer( "mcdv", file );
+       else if ( strstr( file, ".dif" ) )
+               result = mlt_factory_producer( "mcdv", file );
+       else if ( strstr( file, ".jpg" ) )
+               result = mlt_factory_producer( "pixbuf", file );
+       else if ( strstr( file, ".JPG" ) )
+               result = mlt_factory_producer( "pixbuf", file );
+       else if ( strstr( file, ".jpeg" ) )
+               result = mlt_factory_producer( "pixbuf", file );
+       else if ( strstr( file, ".png" ) )
+               result = mlt_factory_producer( "pixbuf", file );
+       else if ( strstr( file, ".tga" ) )
+               result = mlt_factory_producer( "pixbuf", file );
+       else if ( strstr( file, ".txt" ) )
+               result = mlt_factory_producer( "pango", file );
+       else if ( strstr( file, ".ogg" ) )
+               result = mlt_factory_producer( "vorbis", file );
+
+       // 2nd Line fallbacks
+       if ( result == NULL && strstr( file, ".dv" ) )
+               result = mlt_factory_producer( "libdv", file );
+       else if ( result == NULL && strstr( file, ".dif" ) )
+               result = mlt_factory_producer( "libdv", file );
+
+       // 3rd line fallbacks 
+       if ( result == NULL )
+               result = mlt_factory_producer( "avformat", file );
+
+       // 4th line fallbacks 
+       if ( result == NULL )
+               result = mlt_factory_producer( "ffmpeg", file );
+
+       return result;
+}
+
 /** Create or locate a producer for the file specified.
 */
 
-static mlt_producer create_producer( miracle_unit unit, char *file )
+static mlt_producer locate_producer( miracle_unit unit, char *file )
 {
        // Get the unit properties
        mlt_properties properties = unit->producers;
@@ -140,50 +189,12 @@ static mlt_producer create_producer( miracle_unit unit, char *file )
 
        if ( result == NULL )
        {
-               // 1st Line preferences
-               if ( strstr( file, ".inigo" ) )
-                       result = mlt_factory_producer( "inigo_file", file );
-               else if ( strstr( file, ".westley" ) )
-                       result = mlt_factory_producer( "westley", file );
-               else if ( strstr( file, ".mpg" ) )
-                       result = mlt_factory_producer( "mcmpeg", file );
-               else if ( strstr( file, ".mpeg" ) )
-                       result = mlt_factory_producer( "mcmpeg", file );
-               else if ( strstr( file, ".dv" ) )
-                       result = mlt_factory_producer( "mcdv", file );
-               else if ( strstr( file, ".dif" ) )
-                       result = mlt_factory_producer( "mcdv", file );
-               else if ( strstr( file, ".jpg" ) )
-                       result = mlt_factory_producer( "pixbuf", file );
-               else if ( strstr( file, ".JPG" ) )
-                       result = mlt_factory_producer( "pixbuf", file );
-               else if ( strstr( file, ".jpeg" ) )
-                       result = mlt_factory_producer( "pixbuf", file );
-               else if ( strstr( file, ".png" ) )
-                       result = mlt_factory_producer( "pixbuf", file );
-               else if ( strstr( file, ".tga" ) )
-                       result = mlt_factory_producer( "pixbuf", file );
-               else if ( strstr( file, ".txt" ) )
-                       result = mlt_factory_producer( "pango", file );
-               else if ( strstr( file, ".ogg" ) )
-                       result = mlt_factory_producer( "vorbis", file );
-
-               // 2nd Line fallbacks
-               if ( result == NULL && strstr( file, ".dv" ) )
-                       result = mlt_factory_producer( "libdv", file );
-               else if ( result == NULL && strstr( file, ".dif" ) )
-                       result = mlt_factory_producer( "libdv", file );
-       
-               // 3rd line fallbacks 
-               if ( result == NULL )
-                       result = mlt_factory_producer( "avformat", file );
-
-               // 4th line fallbacks 
-               if ( result == NULL )
-                       result = mlt_factory_producer( "ffmpeg", file );
+               // Create the producer
+               result = create_producer( file );
 
                // Now store the result
-               mlt_properties_set_data( properties, file, result, 0, ( mlt_destructor )mlt_producer_close, NULL );
+               if ( result != NULL )
+                       mlt_properties_set_data( properties, file, result, 0, ( mlt_destructor )mlt_producer_close, NULL );
        }
 
        return result;
@@ -256,15 +267,14 @@ void miracle_unit_report_list( miracle_unit unit, valerie_response response )
 
 valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in, int64_t out, int flush )
 {
-       // Have to clear the unit first
-       clear_unit( unit );
-
        // Now try to create an producer
-       mlt_producer instance = create_producer( unit, clip );
+       mlt_producer instance = create_producer( clip );
 
        if ( instance != NULL )
        {
+               clear_unit( unit );
                mlt_properties properties = unit->properties;
+               mlt_properties_set_data( unit->producers, clip, instance, 0, ( mlt_destructor )mlt_producer_close, NULL );
                mlt_playlist playlist = mlt_properties_get_data( properties, "playlist", NULL );
                mlt_playlist_append_io( playlist, instance, in, out );
                miracle_log( LOG_DEBUG, "loaded clip %s", clip );
@@ -277,7 +287,7 @@ valerie_error_code miracle_unit_load( miracle_unit unit, char *clip, int64_t in,
 
 valerie_error_code miracle_unit_insert( miracle_unit unit, char *clip, int index, int64_t in, int64_t out )
 {
-       mlt_producer instance = create_producer( unit, clip );
+       mlt_producer instance = locate_producer( unit, clip );
 
        if ( instance != NULL )
        {
@@ -334,7 +344,7 @@ valerie_error_code miracle_unit_move( miracle_unit unit, int src, int dest )
 
 valerie_error_code miracle_unit_append( miracle_unit unit, char *clip, int64_t in, int64_t out )
 {
-       mlt_producer instance = create_producer( unit, clip );
+       mlt_producer instance = locate_producer( unit, clip );
 
        if ( instance != NULL )
        {
index b82a0e66ef2f90e8382f6869b8eec4db5d6355a4..24d70bb71b195dfda1e1b9bd3c5c4a53dcbbe84c 100644 (file)
@@ -138,9 +138,6 @@ static int producer_collect_info( producer_libdv this )
                        // Parse the header for meta info
                        dv_parse_header( this->dv_decoder, dv_data );
                        mlt_properties_set_double( properties, "aspect_ratio", dv_format_wide( this->dv_decoder ) ? 16.0/9.0 : 4.0/3.0 );
-               
-                       // Set the speed to normal
-                       mlt_properties_set_double( properties, "speed", 1 );
                }
 
                free( dv_data );
index 11f72b74da26dacc43aa9c7f9cfacf283847c563..da1180066f290cf179d7f62bd694f257fd5bb559 100644 (file)
@@ -170,7 +170,7 @@ static int consumer_play_audio( consumer_ffmpeg this, mlt_frame frame, int init_
                while ( bytes > ( sizeof( this->audio_buffer) - this->audio_avail ) )
                        pthread_cond_wait( &this->audio_cond, &this->audio_mutex );
                mlt_properties properties = mlt_frame_properties( frame );
-               if ( mlt_properties_get_double( properties, "speed" ) == 1 )
+               if ( mlt_properties_get_double( properties, "_speed" ) == 1 )
                        memcpy( &this->audio_buffer[ this->audio_avail ], pcm, bytes );
                else
                        memset( &this->audio_buffer[ this->audio_avail ], 0, bytes );
index 15b1c89ec5c0698f67e2304e507f8c6d75c30a69..2432529ee091125884d0c311f605aa295758c5de 100644 (file)
@@ -517,11 +517,11 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 
        // Get the additional properties
        double aspect_ratio = mlt_properties_get_double( producer_properties, "aspect_ratio" );
-       double speed = mlt_properties_get_double( producer_properties, "speed" );
+       double speed = mlt_producer_get_speed( producer );
 
        // Set them on the frame
        mlt_properties_set_double( properties, "aspect_ratio", aspect_ratio );
-       mlt_properties_set_double( properties, "speed", speed );
+       mlt_properties_set_double( properties, "_speed", speed );
 
        // Set the out point on the producer
        if ( this->end_of_video && this->end_of_audio )
index 402a27808fac994a7dfb54de05a39d202423413b..d4a87e185b5c5fe93964089a306183ba03e37207 100644 (file)
@@ -87,8 +87,8 @@ static int resample_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
                                (*buffer)[ i ] = lrint( 32768.0 * sample );
                }
        }
-       else
-               fprintf( stderr, "resample_get_audio: %s\n", src_strerror( i ) );
+       //else
+               //fprintf( stderr, "resample_get_audio: %s\n", src_strerror( i ) );
        
        return 0;
 }
@@ -144,7 +144,7 @@ mlt_filter filter_resample_init( char *arg )
                }
                else
                {
-                       fprintf( stderr, "filter_resample_init: %s\n", src_strerror( error ) );
+                       //fprintf( stderr, "filter_resample_init: %s\n", src_strerror( error ) );
                }
        }
        return this;
index 4fd2068d336541ba23f36e909dee28c63b6248a5..7ee177dd31111222071c7848ea23472baec6f3d5 100644 (file)
@@ -303,7 +303,7 @@ static int consumer_play_audio( consumer_sdl this, mlt_frame frame, int init_aud
                while ( bytes > ( sizeof( this->audio_buffer) - this->audio_avail ) )
                        pthread_cond_wait( &this->audio_cond, &this->audio_mutex );
                mlt_properties properties = mlt_frame_properties( frame );
-               if ( mlt_properties_get_double( properties, "speed" ) == 1 )
+               if ( mlt_properties_get_double( properties, "_speed" ) == 1 )
                        memcpy( &this->audio_buffer[ this->audio_avail ], pcm, bytes );
                else
                        memset( &this->audio_buffer[ this->audio_avail ], 0, bytes );
index 3b37440d4d6b9104b50ad334c8a0bb322d20be1e..be075e8ab248e5ec3d8a20498974f7098ff0951a 100644 (file)
@@ -88,8 +88,11 @@ static inline void serialise_properties( mlt_properties properties, xmlNode *nod
        // Enumerate the properties
        for ( i = 0; i < mlt_properties_count( properties ); i++ )
        {
-               if ( mlt_properties_get_value( properties, i ) != NULL &&
-                       strcmp( mlt_properties_get_name( properties, i ), "westley" ) != 0 )
+               char *name = mlt_properties_get_name( properties, i );
+               if ( name != NULL &&
+                        name[ 0 ] != '_' &&
+                        mlt_properties_get_value( properties, i ) != NULL &&
+                        strcmp( name, "westley" ) != 0 )
                {
 #if 0
                        p = xmlNewChild( node, NULL, "prop", NULL );
index 8c7d9ca64fc740bc1e2903f3a9ec1ad5a63bfb81..265475a064f32b4d8ef671263327f3e8a9d3c23c 100644 (file)
@@ -75,12 +75,21 @@ static void track_service( mlt_properties properties, void *service, mlt_destruc
 static void on_start_tractor( deserialise_context context, const xmlChar *name, const xmlChar **atts)
 {
        mlt_service service = mlt_tractor_service( mlt_tractor_init() );
+       mlt_properties properties = mlt_service_properties( service );
 
        track_service( context->destructors, service, (mlt_destructor) mlt_tractor_close );
 
+       mlt_properties_set_position( properties, "length", 0 );
+
        for ( ; atts != NULL && *atts != NULL; atts += 2 )
                mlt_properties_set( mlt_service_properties( service ), (char*) atts[0], (char*) atts[1] );
 
+       if ( mlt_properties_get_position( properties, "length" ) < mlt_properties_get_position( properties, "out" ) )
+       {
+               mlt_position length = mlt_properties_get_position( properties, "out" ) + 1;
+               mlt_properties_set_position( properties, "length", length );
+       }
+
        context_push_service( context, service );
 }
 
@@ -103,12 +112,20 @@ static void on_start_playlist( deserialise_context context, const xmlChar *name,
 
        track_service( context->destructors, service, (mlt_destructor) mlt_playlist_close );
 
+       mlt_properties_set_position( properties, "length", 0 );
+
        for ( ; atts != NULL && *atts != NULL; atts += 2 )
                mlt_properties_set( properties, (char*) atts[0], (char*) atts[1] );
 
        if ( mlt_properties_get( properties, "id" ) != NULL )
                mlt_properties_set_data( context->producer_map, mlt_properties_get( properties, "id" ), service, 0, NULL, NULL );
 
+       if ( mlt_properties_get_position( properties, "length" ) < mlt_properties_get_position( properties, "out" ) )
+       {
+               mlt_position length = mlt_properties_get_position( properties, "out" ) + 1;
+               mlt_properties_set_position( properties, "length", length );
+       }
+
        context_push_service( context, service );
 }
 
@@ -163,7 +180,7 @@ static void on_start_blank( deserialise_context context, const xmlChar *name, co
        }
 
        // Append a blank to the playlist
-       mlt_playlist_blank( MLT_PLAYLIST( service ), length );
+       mlt_playlist_blank( MLT_PLAYLIST( service ), length - 1 );
 
        // Push the playlist back onto the stack
        context_push_service( context, service );
@@ -419,11 +436,10 @@ mlt_producer producer_westley_init( char *filename )
        if ( !init )
        {
                xmlInitParser();
-               init = 1;
+               //init = 1;
        }
 
        xmlSAXUserParseFile( sax, context, filename );
-       free( sax );
 
        // Need the complete producer list for various reasons
        properties = context->destructors;
@@ -466,7 +482,11 @@ mlt_producer producer_westley_init( char *filename )
 
        free( context->stack_service );
        mlt_properties_close( context->producer_map );
-       free( context );
+       //free( context );
+       free( sax );
+       xmlCleanupParser();
+       xmlMemoryDump( );
+
 
        return MLT_PRODUCER( service );
 }