- // If using hardware scaler
- if ( mlt_properties_get( properties, "rescale" ) != NULL &&
- !strcmp( mlt_properties_get( properties, "rescale" ), "none" ) )
- {
- // Special case optimisation to negate odd effect of sample aspect ratio
- // not corresponding exactly with image resolution.
- if ( ( (int)( this_aspect * 1000 ) == (int)( this->display_aspect * 1000 ) ) &&
- ( (int)( mlt_frame_get_aspect_ratio( frame ) * 1000 ) == (int)( this->aspect_ratio * 1000 ) ) )
- {
- this->rect.w = this->window_width;
- this->rect.h = this->window_height;
- }
- else
- {
- // Use hardware scaler to normalise display aspect ratio
- this->rect.w = frame_aspect / this_aspect * this->window_width;
- this->rect.h = this->window_height;
- if ( this->rect.w > this->window_width )
- {
- this->rect.w = this->window_width;
- this->rect.h = this_aspect / frame_aspect * this->window_height;
- }
- }
- }
- // Special case optimisation to negate odd effect of sample aspect ratio
- // not corresponding exactly with image resolution.
- else if ( (int)( this_aspect * 1000 ) == (int)( this->display_aspect * 1000 ) )
- {
- this->rect.w = this->window_width;
- this->rect.h = this->window_height;
- }
- // Use hardware scaler to normalise sample aspect ratio
- else if ( this->window_height * this->display_aspect > this->window_width )