]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/encoder.c: reverted commit 10351 which breaks aspect ratio...
authorGildas Bazin <gbazin@videolan.org>
Thu, 17 Mar 2005 07:35:35 +0000 (07:35 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 17 Mar 2005 07:35:35 +0000 (07:35 +0000)
modules/codec/ffmpeg/encoder.c

index c6fb8a2c31fd052f9e3c5a5b5b696d8c42a2647e..142aa93359be1900fc2e1a7a482b771dec18ad00 100644 (file)
@@ -346,10 +346,13 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
         p_context->b_frame_strategy = 0;
 
 #if LIBAVCODEC_BUILD >= 4687
-        av_reduce( &p_context->sample_aspect_ratio.num,
-                   &p_context->sample_aspect_ratio.den,
+        av_reduce( &i_aspect_num, &i_aspect_den,
                    p_enc->fmt_in.video.i_aspect,
                    VOUT_ASPECT_FACTOR, 1 << 30 /* something big */ );
+        av_reduce( &p_context->sample_aspect_ratio.num,
+                   &p_context->sample_aspect_ratio.den,
+                   i_aspect_num * (int64_t)p_context->height,
+                   i_aspect_den * (int64_t)p_context->width, 1 << 30 );
 #else
         p_context->aspect_ratio = ((float)p_enc->fmt_in.video.i_aspect) /
             VOUT_ASPECT_FACTOR;