Commit c7d155f6 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg/encoder.c: fixed aspect ratio.

parent 31ab209a
...@@ -326,10 +326,11 @@ int E_(OpenEncoder)( vlc_object_t *p_this ) ...@@ -326,10 +326,11 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
p_context->b_frame_strategy = 0; p_context->b_frame_strategy = 0;
#if LIBAVCODEC_BUILD >= 4687 #if LIBAVCODEC_BUILD >= 4687
p_context->sample_aspect_ratio = av_reduce( &p_context->sample_aspect_ratio.num,
(AVRational){ p_enc->fmt_in.video.i_aspect * &p_context->sample_aspect_ratio.den,
(int64_t)p_context->height / p_context->width, p_enc->fmt_in.video.i_aspect *
VOUT_ASPECT_FACTOR }; (int64_t)p_context->height / p_context->width,
VOUT_ASPECT_FACTOR, INT_MAX );
#else #else
p_context->aspect_ratio = ((float)p_enc->fmt_in.video.i_aspect) / p_context->aspect_ratio = ((float)p_enc->fmt_in.video.i_aspect) /
VOUT_ASPECT_FACTOR; VOUT_ASPECT_FACTOR;
......
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