[vlc-devel] [PATCH 15/15] decoder: adjust the chroma padding after guessing the visible geometry

Steve Lhomme robux4 at ycbcr.xyz
Tue Feb 19 11:45:51 CET 2019


If the chroma padding was incorrectly set by the decoder and it didn't set the
visible geometry it's probably the intended display size. So we shouldn't clean
it beforehand.

This may introduce issues in display modules that currently receive visible
dimensions that are always legit with the given chroma.
---
 src/input/decoder_helpers.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index 674a29dc58..b786c314e0 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -102,18 +102,6 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
 
     dec->fmt_out.video.i_chroma = fmt_out.i_chroma = dec->fmt_out.i_codec;
 
-    if( vlc_fourcc_IsYUV( fmt_out.i_chroma ) )
-    {
-        const vlc_chroma_description_t *dsc = vlc_fourcc_GetChromaDescription( fmt_out.i_chroma );
-        for( unsigned int i = 0; dsc && i < dsc->plane_count; i++ )
-        {
-            while( fmt_out.i_width % dsc->p[i].w.den )
-                fmt_out.i_width++;
-            while( fmt_out.i_height % dsc->p[i].h.den )
-                fmt_out.i_height++;
-        }
-    }
-
     if( !fmt_out.i_visible_width || !fmt_out.i_visible_height )
     {
         if( dec->fmt_in.video.i_visible_width &&
@@ -133,6 +121,18 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
         }
     }
 
+    if( vlc_fourcc_IsYUV( fmt_out.i_chroma ) )
+    {
+        const vlc_chroma_description_t *dsc = vlc_fourcc_GetChromaDescription( fmt_out.i_chroma );
+        for( unsigned int i = 0; dsc && i < dsc->plane_count; i++ )
+        {
+            while( fmt_out.i_width % dsc->p[i].w.den )
+                fmt_out.i_width++;
+            while( fmt_out.i_height % dsc->p[i].h.den )
+                fmt_out.i_height++;
+        }
+    }
+
     if( fmt_out.i_visible_height == 1088 &&
         var_CreateGetBool( dec, "hdtv-fix" ) )
     {
-- 
2.17.1



More information about the vlc-devel mailing list