double progress, double fps, locale_t locale, mlt_keyframe_type interp )
{
int error = 0;
- if ( interp != mlt_keyframe_discrete && fps > 0 &&
+ if ( interp != mlt_keyframe_discrete &&
is_property_numeric( p[1], locale ) && is_property_numeric( p[2], locale ) )
{
double value;
if ( !self->animation )
{
self->animation = mlt_animation_new();
- mlt_animation_parse( self->animation, self->prop_string, length, fps, locale );
+ if ( self->prop_string )
+ {
+ mlt_animation_parse( self->animation, self->prop_string, length, fps, locale );
+ }
+ else
+ {
+ mlt_animation_set_length( self->animation, length );
+ self->types |= mlt_prop_data;
+ self->data = self->animation;
+ self->serialiser = (mlt_serialiser) mlt_animation_serialize;
+ }
}
- else
+ else if ( self->prop_string )
{
mlt_animation_refresh( self->animation, self->prop_string, length );
}
double mlt_property_get_double_pos( mlt_property self, double fps, locale_t locale, int position, int length )
{
double result;
- if ( ( self->types & mlt_prop_string ) && self->prop_string )
+ if ( self->animation || ( ( self->types & mlt_prop_string ) && self->prop_string ) )
{
struct mlt_animation_item_s item;
item.property = mlt_property_init();
int mlt_property_get_int_pos( mlt_property self, double fps, locale_t locale, int position, int length )
{
int result;
- if ( ( self->types & mlt_prop_string ) && self->prop_string )
+ if ( self->animation || ( ( self->types & mlt_prop_string ) && self->prop_string ) )
{
struct mlt_animation_item_s item;
item.property = mlt_property_init();
mlt_keyframe_type keyframe_type, int position, int length )
{
int result;
- if ( ( self->types & mlt_prop_string ) && self->prop_string )
- {
- struct mlt_animation_item_s item;
- item.property = mlt_property_init();
- item.frame = position;
- item.keyframe_type = keyframe_type;
- mlt_property_set_double( item.property, value );
+ struct mlt_animation_item_s item;
+
+ item.property = mlt_property_init();
+ item.frame = position;
+ item.keyframe_type = keyframe_type;
+ mlt_property_set_double( item.property, value );
+
+ refresh_animation( self, fps, locale, length );
+ result = mlt_animation_insert( self->animation, &item );
+ mlt_animation_interpolate( self->animation );
+ mlt_property_close( item.property );
- refresh_animation( self, fps, locale, length );
- result = mlt_animation_insert( self->animation, &item );
- mlt_animation_interpolate( self->animation );
- mlt_property_close( item.property );
- }
- else
- {
- result = mlt_property_set_double( self, value );
- }
return result;
}
mlt_keyframe_type keyframe_type, int position, int length )
{
int result;
- if ( ( self->types & mlt_prop_string ) && self->prop_string )
- {
- struct mlt_animation_item_s item;
- item.property = mlt_property_init();
- item.frame = position;
- item.keyframe_type = keyframe_type;
- mlt_property_set_int( item.property, value );
+ struct mlt_animation_item_s item;
+
+ item.property = mlt_property_init();
+ item.frame = position;
+ item.keyframe_type = keyframe_type;
+ mlt_property_set_int( item.property, value );
+
+ refresh_animation( self, fps, locale, length );
+ result = mlt_animation_insert( self->animation, &item );
+ mlt_animation_interpolate( self->animation );
+ mlt_property_close( item.property );
- refresh_animation( self, fps, locale, length );
- result = mlt_animation_insert( self->animation, &item );
- mlt_animation_interpolate( self->animation );
- mlt_property_close( item.property );
- }
- else
- {
- result = mlt_property_set_int( self, value );
- }
return result;
}