X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fvmfx%2Ffilter_shape.c;h=fdd33e435233bb34eaf30077ca83fe187d903473;hb=ef765a5b52c93b5044a390fbe1c31a412cf59888;hp=54189ab8db05b9b1389cc2ac8ad7ecd45b1e1329;hpb=490c886cd83df28017ce1b83f5bd49682edaf0bd;p=melted diff --git a/src/modules/vmfx/filter_shape.c b/src/modules/vmfx/filter_shape.c index 54189ab..fdd33e4 100644 --- a/src/modules/vmfx/filter_shape.c +++ b/src/modules/vmfx/filter_shape.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_shape.h" +#include #include #include #include @@ -123,6 +123,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) { in = mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "in" ); out = mlt_properties_get_int( MLT_FRAME_PROPERTIES( frame ), "out" ); + position -= in; } // Duration of the shape @@ -144,7 +145,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) if ( strchr( resource, '%' ) ) { FILE *test; - sprintf( temp, "%s/lumas/%s/%s", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ), strchr( resource, '%' ) + 1 ); + sprintf( temp, "%s/lumas/%s/%s", mlt_environment( "MLT_DATA" ), mlt_environment( "MLT_NORMALISATION" ), strchr( resource, '%' ) + 1 ); test = fopen( temp, "r" ); if ( test == NULL ) @@ -162,7 +163,8 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) extension = strrchr( resource, '.' ); } - producer = mlt_factory_producer( NULL, resource ); + mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( this ) ); + producer = mlt_factory_producer( profile, NULL, resource ); if ( producer != NULL ) mlt_properties_set( MLT_PRODUCER_PROPERTIES( producer ), "eof", "loop" ); mlt_properties_set_data( MLT_FILTER_PROPERTIES( this ), "instance", producer, 0, ( mlt_destructor )mlt_producer_close, NULL ); @@ -198,7 +200,10 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) mlt_deque_push_back_double( MLT_FRAME_IMAGE_STACK( frame ), alpha_mix / 100.0 ); mlt_frame_push_get_image( frame, filter_get_image ); if ( mlt_properties_get_int( MLT_FILTER_PROPERTIES( this ), "audio_match" ) ) + { + mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "meta.mixdown", 1 ); mlt_properties_set_double( MLT_FRAME_PROPERTIES( frame ), "meta.volume", alpha_mix / 100.0 ); + } } } @@ -208,7 +213,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) /** Constructor for the filter. */ -mlt_filter filter_shape_init( char *arg ) +mlt_filter filter_shape_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { mlt_filter this = mlt_filter_new( ); if ( this != NULL )