]> git.sesse.net Git - mlt/blobdiff - src/modules/core/filter_resize.c
Fix calloc() parameter ordering
[mlt] / src / modules / core / filter_resize.c
index fbbac56dc00520fd765b926dfc5b19ff5d627a6e..d3e4ca344632738e9bdfe7cf8e3838bb7d75ef30 100644 (file)
@@ -178,6 +178,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
 
        // Pop the top of stack now
        mlt_filter filter = mlt_frame_pop_service( frame );
+       mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );
 
        // Retrieve the aspect ratio
        double aspect_ratio = mlt_deque_pop_back_double( MLT_FRAME_IMAGE_STACK( frame ) );
@@ -186,8 +187,8 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
        // Correct Width/height if necessary
        if ( *width == 0 || *height == 0 )
        {
-               *width = mlt_properties_get_int( properties, "normalised_width" );
-               *height = mlt_properties_get_int( properties, "normalised_height" );
+               *width = profile->width;
+               *height = profile->height;
        }
 
        // Assign requested width/height from our subordinate
@@ -209,10 +210,10 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
        if ( mlt_properties_get_int( properties, "distort" ) == 0 )
        {
                // Normalise the input and out display aspect
-               int normalised_width = mlt_properties_get_int( properties, "normalised_width" );
-               int normalised_height = mlt_properties_get_int( properties, "normalised_height" );
-               int real_width = mlt_properties_get_int( properties, "real_width" );
-               int real_height = mlt_properties_get_int( properties, "real_height" );
+               int normalised_width = profile->width;
+               int normalised_height = profile->height;
+               int real_width = mlt_properties_get_int( properties, "meta.media.width" );
+               int real_height = mlt_properties_get_int( properties, "meta.media.height" );
                if ( real_width == 0 )
                        real_width = mlt_properties_get_int( properties, "width" );
                if ( real_height == 0 )
@@ -285,7 +286,7 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame )
 
 mlt_filter filter_resize_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
-       mlt_filter filter = calloc( sizeof( struct mlt_filter_s ), 1 );
+       mlt_filter filter = calloc( 1, sizeof( struct mlt_filter_s ) );
        if ( mlt_filter_init( filter, filter ) == 0 )
        {
                filter->process = filter_process;