X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ffilter_resize.c;h=537ce505aedfb64e9604b43e5017f04152cbe227;hb=632e745ce62c96c1efc31d66067586fda8e939e0;hp=1ebb7419b5b8b0c317b2b605587fb8692138cf46;hpb=e4c9ccbcef39cadaccbad655bc6e36e825bf3dde;p=melted diff --git a/src/modules/core/filter_resize.c b/src/modules/core/filter_resize.c index 1ebb741..537ce50 100644 --- a/src/modules/core/filter_resize.c +++ b/src/modules/core/filter_resize.c @@ -22,6 +22,7 @@ #include +#include #include #include @@ -33,6 +34,10 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * int owidth = *width; int oheight = *height; mlt_frame_get_image( this, image, format, &owidth, &oheight, 0 ); + if ( *width == 0 ) + *width = 720; + if ( *height == 0 ) + *height = 576; if ( !strcmp( mlt_properties_get( mlt_frame_properties( this ), "resize.scale" ), "affine" ) ) *image = mlt_frame_rescale_yuv422( this, *width, *height ); else @@ -53,13 +58,16 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) /** Constructor for the filter. */ -mlt_filter filter_resize_init( void *arg ) +mlt_filter filter_resize_init( char *arg ) { mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); if ( mlt_filter_init( this, this ) == 0 ) { this->process = filter_process; - mlt_properties_set( mlt_filter_properties( this ), "scale", "off" ); + if ( arg != NULL ) + mlt_properties_set( mlt_filter_properties( this ), "scale", arg ); + else + mlt_properties_set( mlt_filter_properties( this ), "scale", "off" ); } return this; }