// If we have a cut, then use the in/out points from the cut
if ( mlt_producer_is_blank( source ) )
{
+ mlt_position length = out - in + 1;
+
// Make sure the blank is long enough to accomodate the length specified
- if ( out - in + 1 > mlt_producer_get_length( &self->blank ) )
+ if ( length > mlt_producer_get_length( &self->blank ) )
{
mlt_properties blank_props = MLT_PRODUCER_PROPERTIES( &self->blank );
mlt_events_block( blank_props, blank_props );
}
properties = MLT_PRODUCER_PROPERTIES( producer );
+
+ // Make sure this cut of blank is long enough
+ if ( length > mlt_producer_get_length( producer ) )
+ mlt_properties_set_int( properties, "length", length );
}
else if ( mlt_producer_is_cut( source ) )
{
if ( mlt_producer_is_blank( producer ) )
{
- // Make sure the blank is long enough to accomodate the length specified
- if ( out - in + 1 > mlt_producer_get_length( &self->blank ) )
+ mlt_position length = out - in + 1;
+
+ // Make sure the parent blank is long enough to accomodate the length specified
+ if ( length > mlt_producer_get_length( &self->blank ) )
{
mlt_properties blank_props = MLT_PRODUCER_PROPERTIES( &self->blank );
- mlt_properties_set_int( blank_props, "length", out - in + 1 );
- mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( producer ), "length", out - in + 1 );
+ mlt_properties_set_int( blank_props, "length", length );
mlt_producer_set_in_and_out( &self->blank, 0, out - in );
}
+ // Make sure this cut of blank is long enough
+ if ( length > mlt_producer_get_length( producer ) )
+ mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( producer ), "length", length );
}
if ( in < 0 )
mlt_producer split = mlt_producer_cut( entry->producer, in + position + 1, out );
mlt_properties split_properties = MLT_PRODUCER_PROPERTIES( split );
mlt_playlist_insert( self, split, clip + 1, 0, -1 );
+ mlt_properties_lock( entry_properties );
for ( i = 0; i < mlt_properties_count( entry_properties ); i ++ )
{
char *name = mlt_properties_get_name( entry_properties, i );
if ( name != NULL && !strncmp( name, "meta.", 5 ) )
mlt_properties_set( split_properties, name, mlt_properties_get_value( entry_properties, i ) );
}
+ mlt_properties_unlock( entry_properties );
mlt_producer_close( split );
}
else