]> git.sesse.net Git - mlt/commitdiff
Fix filter affine stopping to work at frame 15000.
authorTill Theato <root@ttill.de>
Sun, 5 Sep 2010 01:19:22 +0000 (18:19 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 5 Sep 2010 01:19:22 +0000 (18:19 -0700)
Additionally fix problems with in point > 0 (Kdenlive-1782).

src/modules/plus/filter_affine.c

index bb15152c9f7f819d8c6a80055b57d44bf8e4886a..bf2dfe8e6056acdaca7038c72f89a771bc10f2f5 100644 (file)
@@ -68,14 +68,20 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        char *name = mlt_properties_get( properties, "_unique_id" );
                        mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( this ), name );
                        mlt_properties frame_properties = MLT_FRAME_PROPERTIES( this );
+                       mlt_position in = mlt_filter_get_in( filter );
+                       mlt_position out = mlt_filter_get_out( filter );
                        double consumer_ar = mlt_properties_get_double( frame_properties, "consumer_aspect_ratio" );
-                       mlt_properties_set_position( MLT_TRANSITION_PROPERTIES( transition ), "in", mlt_filter_get_in( filter ) );
-                       mlt_properties_set_position( MLT_TRANSITION_PROPERTIES( transition ), "out", mlt_filter_get_out( filter ) );
-                       mlt_producer_seek( producer, position );
+                       mlt_transition_set_in_and_out( transition, in, out );
+                       if ( out > 0 ) {
+                               mlt_properties_set_position( MLT_PRODUCER_PROPERTIES( producer ), "length", out - in + 1 );
+                               mlt_producer_set_in_and_out( producer, in, out );
+                       }
+                       mlt_producer_seek( producer, position - in );
                        mlt_frame_set_position( this, position );
                        mlt_properties_pass( MLT_PRODUCER_PROPERTIES( producer ), properties, "producer." );
                        mlt_properties_pass( MLT_TRANSITION_PROPERTIES( transition ), properties, "transition." );
                        mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &a_frame, 0 );
+                       mlt_frame_set_position( a_frame, position );
 //                     mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "distort", 1 );
 
                        // Special case - aspect_ratio = 0