swscale: fix aspect-ratio problem properly
authorIlkka Ollakka <ileoo@videolan.org>
Sun, 25 Nov 2012 17:13:37 +0000 (19:13 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Sun, 25 Nov 2012 17:14:34 +0000 (19:14 +0200)
works with transform filter now too, fixes #7437 again.

modules/video_filter/swscale.c

index 7b3d791..7854a30 100644 (file)
@@ -207,8 +207,8 @@ static int OpenScaler( vlc_object_t *p_this )
              (char *)&p_filter->fmt_out.video.i_chroma,
              ppsz_mode_descriptions[i_sws_mode] );
 
-    p_filter->fmt_out.video.i_sar_num = p_filter->fmt_in.video.i_sar_num;
-    p_filter->fmt_out.video.i_sar_den = p_filter->fmt_in.video.i_sar_den;
+    p_filter->fmt_out.video.i_sar_num = p_filter->fmt_in.video.i_sar_num * p_filter->fmt_in.video.i_width / p_filter->fmt_out.video.i_width;
+    p_filter->fmt_out.video.i_sar_den = p_filter->fmt_in.video.i_sar_den * p_filter->fmt_in.video.i_height / p_filter->fmt_out.video.i_height;
 
     return VLC_SUCCESS;
 }