]> git.sesse.net Git - mlt/commitdiff
Whoops - mix fix
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 25 Sep 2004 14:00:52 +0000 (14:00 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 25 Sep 2004 14:00:52 +0000 (14:00 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@447 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_playlist.c

index 762cfa373ca515292443b1f1bd72427558cd1427..9cdc8cf07d3e647f2a2c250d25abfb4dcda37061 100644 (file)
@@ -792,9 +792,6 @@ int mlt_playlist_mix( mlt_playlist this, int clip, int length, mlt_transition tr
                track_b = mlt_producer_cut( clip_b->producer, clip_b->frame_in, clip_b->frame_in + length - 1 );
                mlt_properties_set_int( mlt_producer_properties( track_b ), "cut", 1 );
 
-               mlt_playlist_resize_clip( this, clip, clip_a->frame_in, clip_a->frame_out - length + 1 );
-               mlt_playlist_resize_clip( this, clip + 1, clip_b->frame_in + length, clip_b->frame_out );
-
                mlt_tractor_set_track( tractor, track_a, 0 );
                mlt_tractor_set_track( tractor, track_b, 1 );
                mlt_playlist_insert( this, mlt_tractor_producer( tractor ), clip + 1, -1, -1 );
@@ -807,10 +804,14 @@ int mlt_playlist_mix( mlt_playlist this, int clip, int length, mlt_transition tr
                        mlt_transition_set_in_and_out( transition, 0, length - 1 );
                }
 
-               if ( clip_b->frame_count <= 0 )
+               if ( clip_b->frame_out - clip_b->frame_in > length )
+                       mlt_playlist_resize_clip( this, clip + 2, clip_b->frame_in + length, clip_b->frame_out );
+               else
                        mlt_playlist_remove( this, clip + 2 );
 
-               if ( clip_a->frame_count <= 0 )
+               if ( clip_a->frame_out - clip_a->frame_in > length )
+                       mlt_playlist_resize_clip( this, clip, clip_a->frame_in, clip_a->frame_out - length );
+               else
                        mlt_playlist_remove( this, clip );
 
                mlt_events_unblock( mlt_playlist_properties( this ), this );