int repeat;
mlt_position producer_length;
mlt_event event;
+ int preservation_hack;
}
playlist_entry;
this->list[ i - 1 ] = this->list[ i ];
this->count --;
- // Decouple from mix_in/out if necessary
- if ( mlt_properties_get_data( properties, "mix_in", NULL ) != NULL )
+ if ( entry->preservation_hack == 0 )
{
- mlt_properties mix = mlt_properties_get_data( properties, "mix_in", NULL );
- mlt_properties_set_data( mix, "mix_out", NULL, 0, NULL, NULL );
- }
- if ( mlt_properties_get_data( properties, "mix_out", NULL ) != NULL )
- {
- mlt_properties mix = mlt_properties_get_data( properties, "mix_out", NULL );
- mlt_properties_set_data( mix, "mix_in", NULL, 0, NULL, NULL );
+ // Decouple from mix_in/out if necessary
+ if ( mlt_properties_get_data( properties, "mix_in", NULL ) != NULL )
+ {
+ mlt_properties mix = mlt_properties_get_data( properties, "mix_in", NULL );
+ mlt_properties_set_data( mix, "mix_out", NULL, 0, NULL, NULL );
+ }
+ if ( mlt_properties_get_data( properties, "mix_out", NULL ) != NULL )
+ {
+ mlt_properties mix = mlt_properties_get_data( properties, "mix_out", NULL );
+ mlt_properties_set_data( mix, "mix_in", NULL, 0, NULL, NULL );
+ }
+
+ mlt_producer_clear( entry->producer );
}
// Close the producer associated to the clip info
mlt_event_close( entry->event );
- mlt_producer_clear( entry->producer );
mlt_producer_close( entry->producer );
// Correct position
playlist_entry *entry = this->list[ clip ];
mlt_playlist_append( new_clip, entry->producer );
mlt_playlist_repeat_clip( new_clip, i, entry->repeat );
+ entry->preservation_hack = 1;
mlt_playlist_remove( this, clip );
}
mlt_events_unblock( mlt_playlist_properties( this ), this );
if ( group != NULL )
properties = group;
}
- else if ( !strcmp( argv[ i ], "-attach" ) )
+ else if ( !strcmp( argv[ i ], "-attach" ) || !strcmp( argv[ i ], "-chain" ) )
{
+ int type = !strcmp( argv[ i ], "-attach" ) ? 0 : 1;
mlt_filter filter = create_attach( field, argv[ ++ i ], track );
if ( producer != NULL && !mlt_producer_is_cut( producer ) )
- mlt_playlist_append( playlist, producer );
- producer = NULL;
- if ( filter != NULL && mlt_playlist_count( playlist ) > 0 )
{
mlt_playlist_clip_info info;
+ mlt_playlist_append( playlist, producer );
mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 );
producer = info.cut;
- mlt_service_attach( ( mlt_service )producer, filter );
+ properties = mlt_producer_properties( producer );
+ }
+
+ if ( filter != NULL && mlt_playlist_count( playlist ) > 0 )
+ {
+ if ( type == 0 )
+ mlt_service_attach( ( mlt_service )properties, filter );
+ else
+ mlt_service_attach( ( mlt_service )producer, filter );
+
properties = mlt_filter_properties( filter );
mlt_properties_inherit( properties, group );
}