From 3aaac09c70d6662e453d14dbb4578306a15ebee8 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Sun, 6 Mar 2011 23:45:42 -0800 Subject: [PATCH] Refactor to use mlt_transition_get_length(). --- src/modules/core/transition_composite.c | 12 ++++-------- src/modules/plus/transition_affine.c | 7 +------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index ccceb513..5a041854 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -98,10 +98,8 @@ static mlt_geometry transition_parse_keys( mlt_transition this, int normalised_w // Create an empty geometries object mlt_geometry geometry = mlt_geometry_init( ); - // Get the in and out position - mlt_position in = mlt_transition_get_in( this ); - mlt_position out = mlt_transition_get_out( this ); - int length = out - in + 1; + // Get the duration + mlt_position length = mlt_transition_get_length( this ); double cycle = mlt_properties_get_double( properties, "cycle" ); // Get the new style geometry string @@ -882,9 +880,7 @@ static void crop_calculate( mlt_transition this, mlt_properties properties, stru if ( !crop ) { crop = mlt_geometry_init(); - mlt_position in = mlt_transition_get_in( this ); - mlt_position out = mlt_transition_get_out( this ); - int length = out - in + 1; + mlt_position length = mlt_transition_get_length( this ); double cycle = mlt_properties_get_double( properties, "cycle" ); // Allow a geometry repeat cycle @@ -952,7 +948,7 @@ static mlt_geometry composite_calculate( mlt_transition this, struct geometry_s } else { - int length = mlt_transition_get_out( this ) - mlt_transition_get_in( this ) + 1; + mlt_position length = mlt_transition_get_length( this ); double cycle = mlt_properties_get_double( properties, "cycle" ); if ( cycle > 1 ) length = cycle; diff --git a/src/modules/plus/transition_affine.c b/src/modules/plus/transition_affine.c index 133fe623..793d82a8 100644 --- a/src/modules/plus/transition_affine.c +++ b/src/modules/plus/transition_affine.c @@ -63,13 +63,8 @@ static mlt_geometry transition_parse_keys( mlt_transition this, const char *name // Try to fetch it first mlt_geometry geometry = mlt_properties_get_data( properties, store, NULL ); - // Get the in and out position - int always_active = mlt_properties_get_int( properties, "always_active" ); - mlt_position in = mlt_transition_get_in( this ); - mlt_position out = !always_active ? mlt_transition_get_out( this ) : -1; - // Determine length and obtain cycle - int length = out - in + 1; + mlt_position length = mlt_transition_get_length( this ); double cycle = mlt_properties_get_double( properties, "cycle" ); // Allow a geometry repeat cycle -- 2.39.2