From: lilo_booter Date: Tue, 28 Sep 2004 12:19:43 +0000 (+0000) Subject: Ensure join inherits all attached filters; inigo can attach to producer or previous... X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=688db16f8bb8f2e03b188ff12cdb1c60526ae55e;p=melted Ensure join inherits all attached filters; inigo can attach to producer or previous attachment git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@454 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index c2f4191..6788f1e 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -43,6 +43,7 @@ typedef struct playlist_entry_s int repeat; mlt_position producer_length; mlt_event event; + int preservation_hack; } playlist_entry; @@ -615,21 +616,25 @@ int mlt_playlist_remove( mlt_playlist this, int where ) 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 @@ -799,6 +804,7 @@ int mlt_playlist_join( mlt_playlist this, int clip, int count, int merge ) 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 ); diff --git a/src/modules/inigo/producer_inigo.c b/src/modules/inigo/producer_inigo.c index 4fd82bd..2bb3ccf 100644 --- a/src/modules/inigo/producer_inigo.c +++ b/src/modules/inigo/producer_inigo.c @@ -147,18 +147,26 @@ mlt_producer producer_inigo_init( char **argv ) 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 ); }