[vlc-commits] video_output: always apply the requested aspect ratio

Steve Lhomme git at videolan.org
Thu Sep 3 07:47:36 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Sep  1 14:08:41 2020 +0200| [63c58310c04b5cf2743f8220d782d5089d729eb2] | committer: Steve Lhomme

video_output: always apply the requested aspect ratio

This is a regression from 3.0 where the AR is always applied, no matter the
cropping value.

In 3.0 the aspect ratio is applied before handling the crop, so we do the same.
https://code.videolan.org/videolan/vlc-3.0/-/blob/master/src/video_output/display.c#L866

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

 src/video_output/video_output.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 49a1e9653a..30b2daa738 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -289,14 +289,15 @@ static void vout_SizeWindow(vout_thread_sys_t *vout,
     unsigned sar_num = original->i_sar_num;
     unsigned sar_den = original->i_sar_den;
 
+    if (sys->source.dar.num > 0 && sys->source.dar.den > 0) {
+        unsigned num = sys->source.dar.num * h;
+        unsigned den = sys->source.dar.den * w;
+
+        vlc_ureduce(&sar_num, &sar_den, num, den, 0);
+    }
+
     switch (sys->source.crop.mode) {
         case VOUT_CROP_NONE:
-            if (sys->source.dar.num > 0 && sys->source.dar.den > 0) {
-                unsigned num = sys->source.dar.num * h;
-                unsigned den = sys->source.dar.den * w;
-
-                vlc_ureduce(&sar_num, &sar_den, num, den, 0);
-            }
             break;
 
         case VOUT_CROP_RATIO: {



More information about the vlc-commits mailing list