]> git.sesse.net Git - mlt/blobdiff - src/modules/core/filter_luma.c
make mlt_position type double
[mlt] / src / modules / core / filter_luma.c
index 0a146bebfce49d5aeba678f190a5b4abe70efe6f..37ceeb44ff679b1328a37fbe613d3ce3dac37189 100644 (file)
@@ -46,8 +46,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
        int out = mlt_properties_get_int( properties, "period" );
        int cycle = mlt_properties_get_int( properties, "cycle" );
        int duration = mlt_properties_get_int( properties, "duration" );
-       char *name = mlt_properties_get( properties, "_unique_id" );
-       mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES(this), name );
+       mlt_position position = mlt_filter_get_position( filter, this );
 
        out = out? out + 1 : 25;
        if ( cycle )
@@ -77,8 +76,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                }
        }
 
-       mlt_position modulo_pos = position % out;
-       mlt_log_debug( MLT_FILTER_SERVICE(filter), "pos %d mod period %d\n", position, modulo_pos );
+       mlt_position modulo_pos = MLT_POSITION_MOD(position, out);
+       mlt_log_debug( MLT_FILTER_SERVICE(filter), "pos " MLT_POSITION_FMT " mod period " MLT_POSITION_FMT "\n", position, modulo_pos );
        if ( luma != NULL &&
             ( mlt_properties_get( properties, "blur" ) != NULL ||
                   ( position >= duration && modulo_pos < duration - 1 ) ) )
@@ -104,10 +103,10 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
 
                if ( dst != NULL )
                {
-                       mlt_log_debug( MLT_FILTER_SERVICE(filter), "copying frame %d\n", modulo_pos );
+                       mlt_log_debug( MLT_FILTER_SERVICE(filter), "copying frame " MLT_POSITION_FMT "\n", modulo_pos );
                        mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
                        memcpy( dst, src, size );
-                       mlt_properties_set_data( b_props, "image", dst, size, mlt_pool_release, NULL );
+                       mlt_frame_set_image( b_frame, dst, size, mlt_pool_release );
                        mlt_properties_set_int( b_props, "width", *width );
                        mlt_properties_set_int( b_props, "height", *height );
                        mlt_properties_set_int( b_props, "format", *format );
@@ -124,12 +123,6 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
 
 static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
 {
-       // Get a unique name to store the frame position
-       char *name = mlt_properties_get( MLT_FILTER_PROPERTIES( this ), "_unique_id" );
-
-       // Assign the current position to the name
-       mlt_properties_set_position( MLT_FRAME_PROPERTIES( frame ), name, mlt_frame_get_position( frame ) );
-
        // Push the filter on to the stack
        mlt_frame_push_service( frame, this );