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

Steve Lhomme robux4 at ycbcr.xyz
Tue Sep 1 15:08:44 CEST 2020


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
---
 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 4f48754cf2e..6a0b73d7f5c 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_num;
 
+    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: {
-- 
2.26.2



More information about the vlc-devel mailing list