]> git.sesse.net Git - mlt/commitdiff
Ensure join inherits all attached filters; inigo can attach to producer or previous...
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 28 Sep 2004 12:19:43 +0000 (12:19 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 28 Sep 2004 12:19:43 +0000 (12:19 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@454 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_playlist.c
src/modules/inigo/producer_inigo.c

index c2f41915babec6b17031b4923c1015482851ceee..6788f1e8990b404255bd46f77dcc216329071a70 100644 (file)
@@ -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 );
index 4fd82bd45d1bf01bc1d738321ca10d656e62afeb..2bb3ccff18dd8103d7323d722d08e2b0c42466ce 100644 (file)
@@ -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 );
                        }