[vlc-devel] [PATCH 06/13] decoder: ensure we have a visible geometry

Steve Lhomme robux4 at ycbcr.xyz
Tue Feb 19 10:38:19 CET 2019


It seems wrong to do it after the width/height has been adjusted for the chroma.
The original width/height is more likely how it's intended to be
displayed (and this is an odd value to set by the decoder with mismatching
chroma padding, so this must be it).

But that's how it was done in the vout so we keep it for now
---
 src/input/decoder_helpers.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index 36043753ca..c2242c330a 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -108,6 +108,25 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
         }
     }
 
+    if( !fmt_out.i_visible_width || !fmt_out.i_visible_height )
+    {
+        if( dec->fmt_in.video.i_visible_width &&
+            dec->fmt_in.video.i_visible_height )
+        {
+            fmt_out.i_visible_width  = dec->fmt_in.video.i_visible_width;
+            fmt_out.i_visible_height = dec->fmt_in.video.i_visible_height;
+            fmt_out.i_x_offset       = dec->fmt_in.video.i_x_offset;
+            fmt_out.i_y_offset       = dec->fmt_in.video.i_y_offset;
+        }
+        else
+        {
+            fmt_out.i_visible_width  = fmt_out.i_width;
+            fmt_out.i_visible_height = fmt_out.i_height;
+            fmt_out.i_x_offset       = 0;
+            fmt_out.i_y_offset       = 0;
+        }
+    }
+
     video_format_t original = dec->fmt_out.video;
     dec->fmt_out.video = fmt_out;
     int err = dec->cbs->video.format_update( dec );
-- 
2.17.1



More information about the vlc-devel mailing list