Corrections to filter attachment and in/out point handling
[melted] / src / modules / core / transition_region.c
index e8391c5..c93eec8 100644 (file)
@@ -283,6 +283,9 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                        mlt_properties_set_data( mlt_frame_properties( frame ), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
                }
 
+               // Set the position of the b_frame
+               mlt_frame_set_position( b_frame, position );
+
                // Make sure the filter is in the correct position
                while ( filter != NULL )
                {
@@ -297,6 +300,11 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                        filter = mlt_properties_get_data( properties, id, NULL );
                }
 
+               // Allow filters to be attached to a region filter
+               filter = mlt_properties_get_data( properties, "_region_filter", NULL );
+               if ( filter != NULL )
+                       mlt_service_apply_filters( mlt_filter_service( filter ), b_frame, 0 );
+
                // Hmm - this is probably going to go wrong....
                mlt_frame_set_position( frame, position );