fmt.i_chroma = p_vout->output.i_chroma;
fmt.i_width = p_vout->output.i_width;
fmt.i_height = p_vout->output.i_height;
+ fmt.i_sar_num = p_vout->output.i_aspect * fmt.i_height / fmt.i_width;
+ fmt.i_sar_den = VOUT_ASPECT_FACTOR;
i_scale_width = p_vout->output.i_width * 1000 / p_vout->render.i_width;
i_scale_height = p_vout->output.i_height * 1000 / p_vout->render.i_height;
p_subpic->i_original_picture_height;
}
+ /* Take care of the aspect ratio */
+ if( p_region->fmt.i_sar_num * p_fmt->i_sar_den !=
+ p_region->fmt.i_sar_den * p_fmt->i_sar_num )
+ {
+ i_scale_width = i_scale_width *
+ (int64_t)p_region->fmt.i_sar_num * p_fmt->i_sar_den /
+ p_region->fmt.i_sar_den / p_fmt->i_sar_num;
+ }
+
/* Load the scaling module */
if( !p_spu->p_scale && (i_scale_width != 1000 ||
i_scale_height != 1000) )