[vlc-devel] [PATCH 3/7] display: don't set osys->source SAR in UpdateDisplaySourceProperties

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 13 16:56:30 CET 2020


vout_SetSourceAspect called with non-null SAR, which is guaranteed here, will
also set the same SAR value in osys->source.
---
 src/video_output/display.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 11e14d7cb8a..719def43bdb 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -554,7 +554,8 @@ void VoutFixFormatAR(video_format_t *fmt)
     }
 }
 
-void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t *source, const vlc_rational_t *forced_dar)
+void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t *source,
+                                        const vlc_rational_t *forced_dar)
 {
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
     int err1 = 0, err2 = 0;
@@ -564,13 +565,9 @@ void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t
     if (fixed_src.i_sar_num * osys->source.i_sar_den !=
         fixed_src.i_sar_den * osys->source.i_sar_num) {
 
-        if (forced_dar->num == 0) {
-        osys->source.i_sar_num = fixed_src.i_sar_num;
-        osys->source.i_sar_den = fixed_src.i_sar_den;
-
-        err1 = vout_SetSourceAspect(vd, osys->source.i_sar_num,
-                                    osys->source.i_sar_den);
-        }
+        if (forced_dar->num == 0)
+            err1 = vout_SetSourceAspect(vd, fixed_src.i_sar_num,
+                                            fixed_src.i_sar_den);
     }
     if (source->i_x_offset       != osys->source.i_x_offset ||
         source->i_y_offset       != osys->source.i_y_offset ||
-- 
2.26.2



More information about the vlc-devel mailing list