Commit fad403c0 authored by gbazin's avatar gbazin

* modules/codec/x264.c: fixed aspect ratio.

parent c68071f6
......@@ -135,11 +135,16 @@ static int Open ( vlc_object_t *p_this )
if( p_enc->fmt_in.video.i_aspect > 0 )
{
p_sys->param.vui.i_sar_width = p_enc->fmt_in.video.i_aspect *
p_enc->fmt_in.video.i_height *
p_enc->fmt_in.video.i_height /
p_enc->fmt_in.video.i_width;
p_sys->param.vui.i_sar_height = p_enc->fmt_in.video.i_height;
int64_t i_num, i_den;
int i_dst_num, i_dst_den;
i_num = p_enc->fmt_in.video.i_aspect *
(int64_t)p_enc->fmt_in.video.i_height;
i_den = VOUT_ASPECT_FACTOR * p_enc->fmt_in.video.i_width;
vlc_reduce( &i_dst_num, &i_dst_den, i_num, i_den, 0 );
p_sys->param.vui.i_sar_width = i_dst_num;
p_sys->param.vui.i_sar_height = i_dst_den;
}
if( p_enc->fmt_in.video.i_frame_rate_base > 0 )
{
......
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