}
else
{
- *pi_width = __MIN( i_width, p_vout->render.i_width );
- *pi_height = __MIN( i_height, p_vout->render.i_height );
+ *pi_width = __MIN( i_width, p_vout->fmt_in.i_visible_width );
+ *pi_height = __MIN( i_height, p_vout->fmt_in.i_visible_height );
}
- if( VOUT_ASPECT_FACTOR * *pi_width / *pi_height < p_vout->render.i_aspect )
+ if( p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num *
+ *pi_height /
+ (p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den) >
+ *pi_width )
{
- *pi_width = *pi_height * p_vout->render.i_aspect / VOUT_ASPECT_FACTOR;
+ *pi_height = p_vout->fmt_in.i_visible_height *
+ p_vout->fmt_in.i_sar_den * *pi_width /
+ (p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num);
}
else
{
- *pi_height = *pi_width * VOUT_ASPECT_FACTOR / p_vout->render.i_aspect;
- }
-
- if( *pi_width > i_width )
- {
- *pi_width = i_width;
- *pi_height = VOUT_ASPECT_FACTOR * *pi_width / p_vout->render.i_aspect;
- }
-
- if( *pi_height > i_height )
- {
- *pi_height = i_height;
- *pi_width = *pi_height * p_vout->render.i_aspect / VOUT_ASPECT_FACTOR;
+ *pi_width = p_vout->fmt_in.i_visible_width *
+ p_vout->fmt_in.i_sar_num * *pi_height /
+ (p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den);
}
switch( p_vout->i_alignment & VOUT_ALIGN_HMASK )