Commit d3cb36d5 authored by Marian Ďurkovič's avatar Marian Ďurkovič
Browse files

libmpeg2: Fix aspect ratio calculation according to MPEG standard.

The library delivers us pixel width/height relative to display size
so we must compute it accordingly, otherwise we have conflicting data
in i_sar_num/i_sar_den and i_aspect.
parent 5f8c0412
......@@ -732,10 +732,10 @@ static void GetAR( decoder_t *p_dec )
if( p_sys->p_info->sequence->pixel_height > 0 )
p_sys->i_aspect =
((uint64_t)p_sys->p_info->sequence->picture_width) *
((uint64_t)p_sys->p_info->sequence->display_width) *
p_sys->p_info->sequence->pixel_width *
p_sys->p_info->sequence->picture_height /
p_sys->p_info->sequence->display_height /
p_sys->i_sar_num = p_sys->p_info->sequence->pixel_width;
p_sys->i_sar_den = p_sys->p_info->sequence->pixel_height;
Supports Markdown
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