[vlc-devel] [PATCH 10/15] yuv: only use a local video format when it's used

Steve Lhomme robux4 at ycbcr.xyz
Thu Sep 3 07:52:27 CEST 2020


It's only used to print the format info before the first picture is
displayed. After that the format is not needed anymore.
---
 modules/video_output/yuv.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/modules/video_output/yuv.c b/modules/video_output/yuv.c
index 6d7003e863a..f5789cce28e 100644
--- a/modules/video_output/yuv.c
+++ b/modules/video_output/yuv.c
@@ -174,20 +174,6 @@ static void Display(vout_display_t *vd, picture_t *picture)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    /* */
-    video_format_t fmt = *vd->fmt;
-
-    if (ORIENT_IS_SWAP(vd->source->orientation))
-    {
-        fmt.i_sar_num = vd->source->i_sar_den;
-        fmt.i_sar_den = vd->source->i_sar_num;
-    }
-    else
-    {
-        fmt.i_sar_num = vd->source->i_sar_num;
-        fmt.i_sar_den = vd->source->i_sar_den;
-    }
-
     /* */
     char type;
     if (picture->b_progressive)
@@ -207,6 +193,19 @@ static void Display(vout_display_t *vd, picture_t *picture)
     if (!sys->is_first) {
         const char *header;
         char buffer[5];
+        video_format_t fmt = *vd->fmt;
+
+        if (ORIENT_IS_SWAP(vd->source->orientation))
+        {
+            fmt.i_sar_num = vd->source->i_sar_den;
+            fmt.i_sar_den = vd->source->i_sar_num;
+        }
+        else
+        {
+            fmt.i_sar_num = vd->source->i_sar_num;
+            fmt.i_sar_den = vd->source->i_sar_den;
+        }
+
         if (sys->is_yuv4mpeg2) {
             /* MPlayer compatible header, unfortunately it doesn't tell you
              * the exact fourcc used. */
-- 
2.26.2



More information about the vlc-devel mailing list