From de477d594bdd9c5d9ee2d3441cd0ccf49ab52feb Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Wed, 13 Oct 2004 16:01:05 +0000 Subject: [PATCH] Fix for deep westleys and filter in/out points git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@475 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/framework/mlt_service.c | 4 ++-- src/modules/fezzik/producer_fezzik.c | 2 +- src/modules/valerie/consumer_valerie.c | 23 ++++++++++++++++++----- src/modules/westley/producer_westley.c | 1 + 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/framework/mlt_service.c b/src/framework/mlt_service.c index df416f0..b1f5c25 100644 --- a/src/framework/mlt_service.c +++ b/src/framework/mlt_service.c @@ -319,8 +319,8 @@ void mlt_service_apply_filters( mlt_service this, mlt_frame frame, int index ) mlt_position out = mlt_filter_get_out( base->filters[ i ] ); if ( ( in == 0 && out == 0 ) || ( position >= in && ( position <= out || out == 0 ) ) ) { - mlt_properties_set_position( frame_properties, "in", 0 ); - mlt_properties_set_position( frame_properties, "out", out == 0 ? this_out - this_in : out - in ); + mlt_properties_set_position( frame_properties, "in", in == 0 ? this_in : in ); + mlt_properties_set_position( frame_properties, "out", out == 0 ? this_out : out ); mlt_filter_process( base->filters[ i ], frame ); mlt_service_apply_filters( mlt_filter_service( base->filters[ i ] ), frame, index + 1 ); } diff --git a/src/modules/fezzik/producer_fezzik.c b/src/modules/fezzik/producer_fezzik.c index 22c3510..9a0d9f3 100644 --- a/src/modules/fezzik/producer_fezzik.c +++ b/src/modules/fezzik/producer_fezzik.c @@ -167,7 +167,7 @@ mlt_producer producer_fezzik_init( char *arg ) properties = mlt_producer_properties( producer ); // Attach filters if we have a producer and it isn't already westley'd :-) - if ( producer != NULL && mlt_properties_get( properties, "westley" ) == NULL ) + if ( producer != NULL && mlt_properties_get( properties, "westley" ) == NULL && mlt_properties_get( properties, "_westley" ) == NULL ) attach_normalisers( producer ); // Now make sure we don't lose our identity diff --git a/src/modules/valerie/consumer_valerie.c b/src/modules/valerie/consumer_valerie.c index e473584..781238d 100644 --- a/src/modules/valerie/consumer_valerie.c +++ b/src/modules/valerie/consumer_valerie.c @@ -42,15 +42,28 @@ mlt_consumer consumer_valerie_init( char *arg ) // If no malloc'd and consumer init ok if ( this != NULL && mlt_consumer_init( this, NULL ) == 0 ) { - // Allow thread to be started/stopped - this->start = consumer_start; - this->is_stopped = consumer_is_stopped; + if ( arg != NULL && strchr( arg, ':' ) ) + { + char *temp = NULL; + int port = atoi( strchr( arg, ':' ) + 1 ); + mlt_properties_set( mlt_consumer_properties( this ), "server", arg ); + temp = mlt_properties_get( mlt_consumer_properties( this ), "server" ); + *( strchr( temp, ':' ) ) = '\0'; + mlt_properties_set_int( mlt_consumer_properties( this ), "port", port ); + } + else + { + mlt_properties_set( mlt_consumer_properties( this ), "server", arg == NULL ? "localhost" : arg ); + mlt_properties_set_int( mlt_consumer_properties( this ), "port", 5250 ); + } - mlt_properties_set( mlt_consumer_properties( this ), "server", arg == NULL ? "localhost" : arg ); - mlt_properties_set_int( mlt_consumer_properties( this ), "port", 5250 ); mlt_properties_set_int( mlt_consumer_properties( this ), "unit", 0 ); mlt_properties_set( mlt_consumer_properties( this ), "command", "append" ); + // Allow thread to be started/stopped + this->start = consumer_start; + this->is_stopped = consumer_is_stopped; + // Return the consumer produced return this; } diff --git a/src/modules/westley/producer_westley.c b/src/modules/westley/producer_westley.c index dc6baa5..18aa86b 100644 --- a/src/modules/westley/producer_westley.c +++ b/src/modules/westley/producer_westley.c @@ -1400,6 +1400,7 @@ mlt_producer producer_westley_init( int info, char *data ) else { // Allow the project to be edited + mlt_properties_set( properties, "_westley", "was here" ); mlt_properties_set_int( properties, "_mlt_service_hidden", 1 ); } } -- 1.7.4.4