[vlc-devel] [PATCH] When the demuxer sets dimensions use them rather than the codec values

Steve Lhomme robUx4 at videolabs.io
Thu Mar 5 16:04:53 CET 2015


Doesn't fix #13982 as most video_output don't handle the cropping values attached to decoded planes properly.

Direct3D, DirectDraw and OpenGL create bleeding as in http://i.imgur.com/MzDLw9O.png
Direct2D or GDI create green bars.
---
 src/input/decoder.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 451024b..cc897fb 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2047,23 +2047,25 @@ static int vout_update_format( decoder_t *p_dec )
             }
         }
 
-        if( !fmt.i_visible_width || !fmt.i_visible_height )
+        if( p_dec->fmt_in.video.i_visible_width &&
+            p_dec->fmt_in.video.i_visible_height )
         {
-            if( p_dec->fmt_in.video.i_visible_width &&
-                p_dec->fmt_in.video.i_visible_height )
+            if( fmt.i_visible_width && fmt.i_visible_height )
             {
-                fmt.i_visible_width  = p_dec->fmt_in.video.i_visible_width;
-                fmt.i_visible_height = p_dec->fmt_in.video.i_visible_height;
-                fmt.i_x_offset       = p_dec->fmt_in.video.i_x_offset;
-                fmt.i_y_offset       = p_dec->fmt_in.video.i_y_offset;
-            }
-            else
-            {
-                fmt.i_visible_width  = fmt.i_width;
-                fmt.i_visible_height = fmt.i_height;
-                fmt.i_x_offset       = 0;
-                fmt.i_y_offset       = 0;
+                fmt.i_width  = fmt.i_visible_width;
+                fmt.i_height = fmt.i_visible_height;
             }
+            fmt.i_visible_width  = p_dec->fmt_in.video.i_visible_width;
+            fmt.i_visible_height = p_dec->fmt_in.video.i_visible_height;
+            fmt.i_x_offset       = p_dec->fmt_in.video.i_x_offset;
+            fmt.i_y_offset       = p_dec->fmt_in.video.i_y_offset;
+        }
+        else if( !fmt.i_visible_width || !fmt.i_visible_height )
+        {
+            fmt.i_visible_width  = fmt.i_width;
+            fmt.i_visible_height = fmt.i_height;
+            fmt.i_x_offset       = 0;
+            fmt.i_y_offset       = 0;
         }
 
         if( fmt.i_visible_height == 1088 &&
-- 
2.2.2




More information about the vlc-devel mailing list