Commit 93ddf745 authored by Gildas Bazin's avatar Gildas Bazin

* src/video_output/vout_pictures.c: use fmt_in.i_visible_width/height and...

* src/video_output/vout_pictures.c: use fmt_in.i_visible_width/height and i_sar_num/den in vout_PlacePicture().
parent d515ca53
......@@ -440,29 +440,24 @@ void vout_PlacePicture( vout_thread_t *p_vout,
}
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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment