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

Ilkka Ollakka git at videolan.org
Sat Nov 9 18:20:26 CET 2013


vlc/vlc-2.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Nov  9 18:11:48 2013 +0200| [db85a68711a50f2cdb5e337345aacd3db1022e46] | committer: Jean-Baptiste Kempf

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

(cherry picked from commit 82d842bf0df8b605703ea761749a24fcd6407e14)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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