geometry_item prev = current->prev;
geometry_item next = current->next;
- float prev_value = 0;
- float next_value = 0;
- float value = 0;
+ double prev_value = 0;
+ double next_value = 0;
+ double value = 0;
while( prev != NULL && !prev->data.f[ i ] ) prev = prev->prev;
while( next != NULL && !next->data.f[ i ] ) next = next->next;
// Handle fx only tracks
if ( mlt_properties_get_int( temp_properties, "meta.fx_cut" ) )
{
- // Take all but the first placeholding producer and dump on to the image stack
+ mlt_properties copy = video == NULL ? frame_properties : MLT_FRAME_PROPERTIES( video );
+ int i = 0;
+
+ for ( i = 0; i < mlt_properties_count( temp_properties ); i ++ )
+ {
+ char *name = mlt_properties_get_name( temp_properties, i );
+ char *value = mlt_properties_get_value( temp_properties, i );
+ // For animated filters
+ if ( isdigit( name[ 0 ] ) && value != NULL )
+ mlt_properties_set( copy, name, value );
+ }
+
if ( video )
{
+ // Take all but the first placeholding producer and dump on to the image stack
void *p = mlt_deque_pop_front( MLT_FRAME_IMAGE_STACK( temp ) );
while ( ( p = mlt_deque_pop_front( MLT_FRAME_IMAGE_STACK( temp ) ) ) != NULL )
mlt_deque_push_back( MLT_FRAME_IMAGE_STACK( video ), p );
}
+ else
+ {
+ void *p = NULL;
+ while ( ( p = mlt_deque_pop_front( MLT_FRAME_IMAGE_STACK( temp ) ) ) != NULL )
+ mlt_deque_push_back( MLT_FRAME_IMAGE_STACK( *frame ), p );
+ mlt_properties_set_int( frame_properties, "meta.fx_cut", 1 );
+ }
- // Take all but the first placeholding producer and dump on to the audio stack
if ( audio )
{
+ // Take all but the first placeholding producer and dump on to the audio stack
void *p = mlt_deque_pop_front( MLT_FRAME_AUDIO_STACK( temp ) );
while ( ( p = mlt_deque_pop_front( MLT_FRAME_AUDIO_STACK( temp ) ) ) != NULL )
mlt_deque_push_back( MLT_FRAME_AUDIO_STACK( audio ), p );
}
+ else
+ {
+ void *p = NULL;
+ while ( ( p = mlt_deque_pop_front( MLT_FRAME_AUDIO_STACK( temp ) ) ) != NULL )
+ mlt_deque_push_back( MLT_FRAME_AUDIO_STACK( *frame ), p );
+ mlt_properties_set_int( frame_properties, "meta.fx_cut", 1 );
+ }
// Ensure everything is hidden
mlt_properties_set_int( temp_properties, "hide", 3 );
audio = temp;
if ( !done && !mlt_frame_is_test_card( temp ) && !( mlt_properties_get_int( temp_properties, "hide" ) & 1 ) )
video = temp;
+
}
// Now stack callbacks
/** Calculate real geometry.
*/
-static void geometry_calculate( mlt_transition this, struct geometry_s *output, float position )
+static void geometry_calculate( mlt_transition this, struct geometry_s *output, double position )
{
mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
mlt_geometry geometry = mlt_properties_get_data( properties, "geometries", NULL );
/** Calculate the field delta for this frame - position between two frames.
*/
-static inline float delta_calculate( mlt_transition this, mlt_frame frame )
+static inline double delta_calculate( mlt_transition this, mlt_frame frame )
{
// Get the in and out position
mlt_position in = mlt_transition_get_in( this );
mlt_position out = mlt_transition_get_out( this );
- float length = out - in + 1;
+ double length = out - in + 1;
// Get the position of the frame
char *name = mlt_properties_get( MLT_TRANSITION_PROPERTIES( this ), "_unique_id" );
mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( frame ), name );
// Now do the calcs
- float x = ( float )( position - in ) / length;
- float y = ( float )( position + 1 - in ) / length;
+ double x = ( double )( position - in ) / length;
+ double y = ( double )( position + 1 - in ) / length;
return length * ( y - x ) / 2.0;
}
}
-static mlt_geometry composite_calculate( mlt_transition this, struct geometry_s *result, mlt_frame a_frame, float position )
+static mlt_geometry composite_calculate( mlt_transition this, struct geometry_s *result, mlt_frame a_frame, double position )
{
// Get the properties from the transition
mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
// Will need to know region to copy
struct geometry_s result;
- float delta = delta_calculate( this, a_frame );
+ double delta = delta_calculate( this, a_frame );
// Calculate the region now
composite_calculate( this, &result, a_frame, position + delta / 2 );
struct geometry_s result;
// Calculate the position
- float position = mlt_properties_get_double( b_props, "relative_position" );
- float delta = delta_calculate( this, a_frame );
+ double position = mlt_properties_get_double( b_props, "relative_position" );
+ double delta = delta_calculate( this, a_frame );
// Get the image from the b frame
uint8_t *image_b = NULL;
for ( field = 0; field < ( progressive ? 1 : 2 ); field++ )
{
// Assume lower field (0) first
- float field_position = position + field * delta;
+ double field_position = position + field * delta;
// Do the calculation if we need to
composite_calculate( this, &result, a_frame, field_position );
}
// Default window size
- this->window_width = ( float )this->height * display_ratio;
+ this->window_width = ( double )this->height * display_ratio;
this->window_height = this->height;
// Set the sdl flags
consumer_sdl this = udata;
// Get the volume
- float volume = mlt_properties_get_double( this->properties, "volume" );
+ double volume = mlt_properties_get_double( this->properties, "volume" );
pthread_mutex_lock( &this->audio_mutex );
memcpy( stream, this->audio_buffer, this->audio_avail );
// Mix the audio
- SDL_MixAudio( stream, stream, len, ( int )( ( float )SDL_MIX_MAXVOLUME * volume ) );
+ SDL_MixAudio( stream, stream, len, ( int )( ( double )SDL_MIX_MAXVOLUME * volume ) );
// No audio left
this->audio_avail = 0;
if ( this->running )
{
// Determine window's new display aspect ratio
- float this_aspect = ( float )this->window_width / this->window_height;
+ double this_aspect = ( double )this->window_width / this->window_height;
// Get the display aspect ratio
double display_ratio = mlt_properties_get_double( properties, "display_ratio" );
// Determine frame's display aspect ratio
- float frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height;
+ double frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height;
// Store the width and height received
this->width = width;
}
// Default window size
- this->window_width = ( float )this->height * display_ratio;
+ this->window_width = ( double )this->height * display_ratio;
this->window_height = this->height;
// Set the sdl flags
char *rescale = mlt_properties_get( properties, "rescale" );
if ( rescale != NULL && strcmp( rescale, "none" ) )
{
- float this_aspect = display_ratio / ( ( float )this->window_width / ( float )this->window_height );
+ double this_aspect = display_ratio / ( ( double )this->window_width / ( double )this->window_height );
this->rect.w = this_aspect * this->window_width;
this->rect.h = this->window_height;
if ( this->rect.w > this->window_width )
}
else
{
- float frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height;
+ double frame_aspect = mlt_frame_get_aspect_ratio( frame ) * width / height;
this->rect.w = frame_aspect * this->window_height;
this->rect.h = this->window_height;
if ( this->rect.w > this->window_width )