From 8ad18633ab01f630da1f09a3efd3acc1307b46e7 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Fri, 31 Dec 2004 12:18:26 +0000 Subject: [PATCH] Corrections after valgrinding git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@597 d19143bc-622f-0410-bfdd-b5b2a6649095 --- demo/demo.ini | 2 +- src/framework/mlt_producer.c | 5 +++++ src/framework/mlt_properties.c | 11 ++++++++++- src/framework/mlt_property.c | 15 +++++++++++---- src/framework/mlt_transition.c | 5 +++++ 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/demo/demo.ini b/demo/demo.ini index 9310326..b01b049 100644 --- a/demo/demo.ini +++ b/demo/demo.ini @@ -16,7 +16,7 @@ mlt_title_over_gfx Title over graphic watermark1.png,clip1.dv mlt_slideshow Slideshow Scotland mlt_bouncy Bouncy, Bouncy clip1.dv,clip3.dv mlt_bouncy_ball Bouncy, Bouncy Ball clip1.mpeg,clip3.mpeg,circle.png -mlt_news Breaking News clip1.mpeg,clip2.mpeg +mlt_news Breaking News clip1.dv,clip2.dv mlt_squeeze Squeeze Transitions clip1.dv,clip2.dv,clip3.dv mlt_squeeze_box Squeeze Box clip1.dv,clip2.dv,clip3.dv mlt_jcut J Cut clip1.dv,clip2.dv diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index db69aa6..3382d11 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -837,6 +837,8 @@ void mlt_producer_close( mlt_producer this ) } else { + int destroy = mlt_producer_is_cut( this ); + #if _MLT_PRODUCER_CHECKS_ == 1 // Show debug info mlt_properties_debug( MLT_PRODUCER_PROPERTIES( this ), "Producer closing", stderr ); @@ -851,6 +853,9 @@ void mlt_producer_close( mlt_producer this ) #endif mlt_service_close( &this->parent ); + + if ( destroy ) + free( this ); } } } diff --git a/src/framework/mlt_properties.c b/src/framework/mlt_properties.c index df2e7b4..53db476 100644 --- a/src/framework/mlt_properties.c +++ b/src/framework/mlt_properties.c @@ -346,7 +346,16 @@ int mlt_properties_set( mlt_properties this, char *name, char *value ) mlt_property property = mlt_properties_fetch( this, name ); // Set it if not NULL - if ( property != NULL && ( value == NULL || value[ 0 ] != '@' ) ) + if ( property == NULL ) + { + fprintf( stderr, "Whoops\n" ); + } + else if ( value == NULL ) + { + error = mlt_property_set_string( property, value ); + mlt_properties_do_mirror( this, name ); + } + else if ( *value != '@' ) { error = mlt_property_set_string( property, value ); mlt_properties_do_mirror( this, name ); diff --git a/src/framework/mlt_property.c b/src/framework/mlt_property.c index a4bba69..ddc000c 100644 --- a/src/framework/mlt_property.c +++ b/src/framework/mlt_property.c @@ -112,10 +112,17 @@ int mlt_property_set_position( mlt_property this, mlt_position value ) int mlt_property_set_string( mlt_property this, char *value ) { - mlt_property_clear( this ); - this->types = mlt_prop_string; - if ( value != NULL ) - this->prop_string = strdup( value ); + if ( value != this->prop_string ) + { + mlt_property_clear( this ); + this->types = mlt_prop_string; + if ( value != NULL ) + this->prop_string = strdup( value ); + } + else + { + this->types = mlt_prop_string; + } return this->prop_string == NULL; } diff --git a/src/framework/mlt_transition.c b/src/framework/mlt_transition.c index 6e1649c..435fdb6 100644 --- a/src/framework/mlt_transition.c +++ b/src/framework/mlt_transition.c @@ -253,8 +253,13 @@ void mlt_transition_close( mlt_transition this ) { this->parent.close = NULL; if ( this->close != NULL ) + { this->close( this ); + } else + { mlt_service_close( &this->parent ); + free( this ); + } } } -- 1.7.4.4