[vlc-commits] swscale: fix aspect-ratio problem properly

Ilkka Ollakka git at videolan.org
Sun Nov 25 18:16:51 CET 2012


vlc/vlc-2.0 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Nov 25 19:13:37 2012 +0200| [48b8119ce865cb347b44b31b84a4aac7502e4a22] | committer: Ilkka Ollakka

swscale: fix aspect-ratio problem properly

works with transform filter now too, fixes #7437 again.
(cherry picked from commit 0330378c55b8b940f6de82adb59cc32c5b3da12a)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=48b8119ce865cb347b44b31b84a4aac7502e4a22
---

 modules/video_filter/swscale.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_filter/swscale.c b/modules/video_filter/swscale.c
index a1765c3..68eafa5 100644
--- a/modules/video_filter/swscale.c
+++ b/modules/video_filter/swscale.c
@@ -208,8 +208,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;
 }



More information about the vlc-commits mailing list