[vlc-commits] src/image: correctly handle anamorphic content sizes (closes #13862)

Felix Paul Kühne git at videolan.org
Tue Jun 23 20:33:16 CEST 2015


vlc/vlc-2.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jun 23 15:18:12 2015 +0200| [780e1ea7cf3951ed332b870fe2a4406574e47fe7] | committer: Felix Paul Kühne

src/image: correctly handle anamorphic content sizes (closes #13862)

This fixes a regression introduced in e3b809c1

(cherry picked from commit c342e2ef72c9ab83f5bd7add27b41b5de6eeab2c)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=780e1ea7cf3951ed332b870fe2a4406574e47fe7
---

 src/misc/image.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/misc/image.c b/src/misc/image.c
index f5be25b..247b681 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -730,17 +730,16 @@ static encoder_t *CreateEncoder( vlc_object_t *p_this, video_format_t *fmt_in,
                 p_enc->fmt_in.video.i_visible_height = fmt_out->i_height;
             }
         }
-        else if( fmt_out->i_sar_num && fmt_out->i_sar_den &&
-                 fmt_out->i_sar_num * fmt_in->i_sar_den !=
-                 fmt_out->i_sar_den * fmt_in->i_sar_num )
-        {
-            p_enc->fmt_in.video.i_width =
-                fmt_in->i_sar_num * (int64_t)fmt_out->i_sar_den * fmt_in->i_width /
-                fmt_in->i_sar_den / fmt_out->i_sar_num;
-            p_enc->fmt_in.video.i_visible_width =
-                fmt_in->i_sar_num * (int64_t)fmt_out->i_sar_den *
-                fmt_in->i_visible_width / fmt_in->i_sar_den / fmt_out->i_sar_num;
-        }
+    } else if( fmt_out->i_sar_num && fmt_out->i_sar_den &&
+               fmt_out->i_sar_num * fmt_in->i_sar_den !=
+               fmt_out->i_sar_den * fmt_in->i_sar_num )
+    {
+        p_enc->fmt_in.video.i_width =
+            fmt_in->i_sar_num * (int64_t)fmt_out->i_sar_den * fmt_in->i_width /
+            fmt_in->i_sar_den / fmt_out->i_sar_num;
+        p_enc->fmt_in.video.i_visible_width =
+            fmt_in->i_sar_num * (int64_t)fmt_out->i_sar_den *
+            fmt_in->i_visible_width / fmt_in->i_sar_den / fmt_out->i_sar_num;
     }
 
     p_enc->fmt_in.video.i_frame_rate = 25;



More information about the vlc-commits mailing list