[vlc-commits] canvas: handle sar{0,1} and assume it to be 1:1

Ilkka Ollakka git at videolan.org
Sat Nov 9 17:41:18 CET 2013


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Nov  9 18:11:48 2013 +0200| [82d842bf0df8b605703ea761749a24fcd6407e14] | committer: Ilkka Ollakka

canvas: handle sar{0,1} and assume it to be 1:1

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82d842bf0df8b605703ea761749a24fcd6407e14
---

 modules/video_filter/canvas.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/video_filter/canvas.c b/modules/video_filter/canvas.c
index ca3f73e..8198f8a 100644
--- a/modules/video_filter/canvas.c
+++ b/modules/video_filter/canvas.c
@@ -180,11 +180,17 @@ static int Activate( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    i_fmt_in_aspect = (int64_t)p_filter->fmt_in.video.i_sar_num *
+    if( p_filter->fmt_in.video.i_sar_num )
+        i_fmt_in_aspect = (int64_t)p_filter->fmt_in.video.i_sar_num *
                       p_filter->fmt_in.video.i_width *
                       VOUT_ASPECT_FACTOR /
                       p_filter->fmt_in.video.i_sar_den /
                       p_filter->fmt_in.video.i_height;
+    else
+        i_fmt_in_aspect = (int64_t)p_filter->fmt_in.video.i_width *
+                      VOUT_ASPECT_FACTOR /
+                      p_filter->fmt_in.video.i_height;
+
     psz_aspect = var_CreateGetNonEmptyString( p_filter, CFG_PREFIX "aspect" );
     if( psz_aspect )
     {



More information about the vlc-commits mailing list