[vlc-devel] [PATCH] [RFC] picture: add the y offset to the planes i_visible_lines

Steve Lhomme robux4 at videolabs.io
Thu Aug 18 14:57:03 CEST 2016


Since the planes have no notion of the x/y offset we need to make sure enough
data are handled when going through filters and plane copying. So it makes
sense to add the offset to i_visible_lines which is only used for that. Its
name might be misleading though.

Without this patch playing offset_test.ogv on fails on renderers that just rely
on picture_Copy() which only copy visible lines.

--
replaces https://patches.videolan.org/patch/9995/ with just the offset added
---
 src/misc/picture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/misc/picture.c b/src/misc/picture.c
index 0cdbd0e..191d7ba 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -185,7 +185,7 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
         plane_t *p = &p_picture->p[i];
 
         p->i_lines         = (i_height_aligned + i_height_extra ) * p_dsc->p[i].h.num / p_dsc->p[i].h.den;
-        p->i_visible_lines = fmt->i_visible_height * p_dsc->p[i].h.num / p_dsc->p[i].h.den;
+        p->i_visible_lines = (fmt->i_y_offset + fmt->i_visible_height) * p_dsc->p[i].h.num / p_dsc->p[i].h.den;
         p->i_pitch         = i_width_aligned * p_dsc->p[i].w.num / p_dsc->p[i].w.den * p_dsc->pixel_size;
         p->i_visible_pitch = fmt->i_visible_width * p_dsc->p[i].w.num / p_dsc->p[i].w.den * p_dsc->pixel_size;
         p->i_pixel_pitch   = p_dsc->pixel_size;
-- 
2.9.1



More information about the vlc-devel mailing list