Commit 7a70363d authored by Gildas Bazin's avatar Gildas Bazin

* src/video_output/vout_subpictures.c: proper subpicture scaling using sample...

* src/video_output/vout_subpictures.c: proper subpicture scaling using sample aspect ratio information.
parent 6e9e7e36
......@@ -300,6 +300,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
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;
......
......@@ -497,6 +497,15 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
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) )
......
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