[vlc-devel] [PATCH 2/3] picture: copy the crop information in picture_Setup()

Steve Lhomme robux4 at ycbcr.xyz
Mon Sep 17 10:51:20 CEST 2018


It's done in picture_NewPrivate() but not here. So it ends up lost.

Ref: #21192
---
 src/misc/picture.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/misc/picture.c b/src/misc/picture.c
index 0740f06c83..b08ac56a11 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -106,6 +106,11 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
     video_format_Setup( &p_picture->format, fmt->i_chroma, fmt->i_width, fmt->i_height,
                         fmt->i_visible_width, fmt->i_visible_height,
                         fmt->i_sar_num, fmt->i_sar_den );
+    if( fmt->i_x_offset < fmt->i_width &&
+        fmt->i_y_offset < fmt->i_height &&
+        fmt->i_visible_width  > 0 && fmt->i_x_offset + fmt->i_visible_width  <= fmt->i_width &&
+        fmt->i_visible_height > 0 && fmt->i_y_offset + fmt->i_visible_height <= fmt->i_height )
+        video_format_CopyCrop( &p_picture->format, fmt );
 
     const vlc_chroma_description_t *p_dsc =
         vlc_fourcc_GetChromaDescription( p_picture->format.i_chroma );
-- 
2.17.0



More information about the vlc-devel mailing list