git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@455
d19143bc-622f-0410-bfdd-
b5b2a6649095
{
mlt_position position = mlt_frame_get_position( *frame );
if ( position >= in && ( out == 0 || position <= out ) )
{
mlt_position position = mlt_frame_get_position( *frame );
if ( position >= in && ( out == 0 || position <= out ) )
+ {
+ mlt_frame_set_position( *frame, position - in );
*frame = mlt_filter_process( this, *frame );
*frame = mlt_filter_process( this, *frame );
+ mlt_frame_set_position( *frame, position + in );
+ }
mlt_properties frame_properties = mlt_frame_properties( frame );
mlt_properties filter_properties = mlt_service_properties( this );
mlt_service_base *base = this->local;
mlt_properties frame_properties = mlt_frame_properties( frame );
mlt_properties filter_properties = mlt_service_properties( this );
mlt_service_base *base = this->local;
- mlt_position position = mlt_properties_get_position( frame_properties, "_position" );
+ mlt_position position = mlt_frame_get_position( frame );
+ mlt_position this_in = mlt_properties_get_position( filter_properties, "in" );
// Hmm - special case for cuts - apply filters from the parent first
if ( mlt_properties_get_int( filter_properties, "_cut" ) )
// Hmm - special case for cuts - apply filters from the parent first
if ( mlt_properties_get_int( filter_properties, "_cut" ) )
+ {
+ position -= this_in;
+ mlt_frame_set_position( frame, position );
mlt_service_apply_filters( ( mlt_service )mlt_properties_get_data( filter_properties, "_cut_parent", NULL ), frame, 0 );
mlt_service_apply_filters( ( mlt_service )mlt_properties_get_data( filter_properties, "_cut_parent", NULL ), frame, 0 );
if ( index == 0 || mlt_properties_get_int( filter_properties, "_filter_private" ) == 0 )
{
if ( index == 0 || mlt_properties_get_int( filter_properties, "_filter_private" ) == 0 )
{
if ( base->filters[ i ] != NULL )
{
mlt_properties properties = mlt_filter_properties( base->filters[ i ] );
if ( base->filters[ i ] != NULL )
{
mlt_properties properties = mlt_filter_properties( base->filters[ i ] );
- mlt_position in = mlt_properties_get_position( properties, "in" );
- mlt_position out = mlt_properties_get_position( properties, "out" );
+ mlt_position in = mlt_filter_get_in( base->filters[ i ] );
+ mlt_position out = mlt_filter_get_out( base->filters[ i ] );
if ( ( in == 0 && out == 0 ) || ( position >= in && ( position <= out || out == 0 ) ) )
{
if ( ( in == 0 && out == 0 ) || ( position >= in && ( position <= out || out == 0 ) ) )
{
+ mlt_frame_set_position( frame, position - in );
mlt_filter_process( base->filters[ i ], frame );
mlt_filter_process( base->filters[ i ], frame );
- mlt_properties_set_position( frame_properties, "_position", position - in );
mlt_service_apply_filters( mlt_filter_service( base->filters[ i ] ), frame, index + 1 );
mlt_service_apply_filters( mlt_filter_service( base->filters[ i ] ), frame, index + 1 );
- mlt_properties_set_position( frame_properties, "_position", position );
+ mlt_frame_set_position( frame, position + in );
+
+ if ( mlt_properties_get_int( filter_properties, "_cut" ) )
+ mlt_frame_set_position( frame, position + this_in );
char *name = mlt_properties_get( mlt_filter_properties( this ), "_unique_id" );
// Assign the current position to the name
char *name = mlt_properties_get( mlt_filter_properties( this ), "_unique_id" );
// Assign the current position to the name
- mlt_properties_set_position( properties, name, mlt_frame_get_position( frame ) - mlt_filter_get_in( this ) );
+ mlt_properties_set_position( properties, name, mlt_frame_get_position( frame ) );
// Push the filter on to the stack
mlt_frame_push_service( frame, this );
// Push the filter on to the stack
mlt_frame_push_service( frame, this );
output->mix = out->mix;
output->distort = out->distort;
}
output->mix = out->mix;
output->distort = out->distort;
}
-
- // Definitely incorrect...
-#if 0
- if ( ( int )output->x & 1 && ( int )output->w & 1 )
- {
- output->x -= 1.0;
- output->w += 1.0;
- }
- else if ( ( int )output->x & 1 )
- {
- output->x += 1.0;
- }
- else if ( ( int )output->w & 1 )
- {
- output->w += 1.0;
- }
-#endif
}
static void transition_destroy_keys( void *arg )
}
static void transition_destroy_keys( void *arg )
if ( y + h > height )
h = height - y;
if ( y + h > height )
h = height - y;
- //x = ( x | 1 ) ^ 1;
- //w = ( w | 1 ) ^ 1;
+ x = ( x | 1 ) ^ 1;
+ w = ( w | 1 ) ^ 1;
// Now we need to create a new destination image
dest = mlt_pool_alloc( w * h * 2 );
// Now we need to create a new destination image
dest = mlt_pool_alloc( w * h * 2 );
mlt_properties_set_data( mlt_frame_properties( frame ), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
}
mlt_properties_set_data( mlt_frame_properties( frame ), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
}
+ // Set the position of the b_frame
+ mlt_frame_set_position( b_frame, position );
+
// Make sure the filter is in the correct position
while ( filter != NULL )
{
// Make sure the filter is in the correct position
while ( filter != NULL )
{
mlt_playlist_append( playlist, producer );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
mlt_playlist_append( playlist, producer );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
- properties = mlt_producer_properties( producer );
}
if ( filter != NULL && mlt_playlist_count( playlist ) > 0 )
}
if ( filter != NULL && mlt_playlist_count( playlist ) > 0 )
// Push the frame filter
mlt_frame_push_service( frame, this );
mlt_frame_push_get_image( frame, filter_get_image );
// Push the frame filter
mlt_frame_push_service( frame, this );
mlt_frame_push_get_image( frame, filter_get_image );
mlt_frame_get_image( a_frame, image, format, width, height, 1 );
// Calculate the region now
mlt_frame_get_image( a_frame, image, format, width, height, 1 );
// Calculate the region now
- composite_calculate( &result, this, a_frame, ( float )( position - in ) / ( out - in + 1 ) );
+ composite_calculate( &result, this, a_frame, ( float )( position ) / ( out - in + 1 ) );
// Fetch the b frame image
result.w = ( int )( result.w * *width / result.nw );
// Fetch the b frame image
result.w = ( int )( result.w * *width / result.nw );
// Push the transition method
mlt_frame_push_get_image( a_frame, transition_get_image );
// Push the transition method
mlt_frame_push_get_image( a_frame, transition_get_image );