Commit bcf79896 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: mp4: fix fallback on PAR (fix #11075)

parent 56211a99
......@@ -1773,8 +1773,15 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
if( p_pasp && p_pasp->data.p_pasp->i_horizontal_spacing > 0 &&
p_pasp->data.p_pasp->i_vertical_spacing > 0 )
{
p_track->fmt.video.i_sar_num = p_pasp->data.p_pasp->i_horizontal_spacing;
p_track->fmt.video.i_sar_den = p_pasp->data.p_pasp->i_vertical_spacing;
/* Convert pixel ratio to picture/display aspect ratio */
/* SAR * PAR -> DAR */
vlc_ureduce( &p_track->fmt.video.i_sar_num, &p_track->fmt.video.i_sar_den,
(uint64_t) p_pasp->data.p_pasp->i_horizontal_spacing
* p_track->fmt.video.i_width,
(uint64_t) p_pasp->data.p_pasp->i_vertical_spacing
* p_track->fmt.video.i_height,
UINT32_MAX
);
}
/* Support for cropping (eg. in H263 files) */
......
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