[vlc-devel] [PATCH 3/3] picture: add the x/y offset to the visible pitch/lines
Steve Lhomme
robux4 at videolabs.io
Thu Aug 18 15:57:03 CEST 2016
--
replaces https://patches.videolan.org/patch/14283/ with the pitch added
replaces https://patches.videolan.org/patch/9995/ with the video_format_CopyCrop()
in another patch
---
src/misc/picture.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/misc/picture.c b/src/misc/picture.c
index 877af32..d550b94 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -186,9 +186,9 @@ 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_visible_pitch = (fmt->i_x_offset + 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;
assert( (p->i_pitch % 16) == 0 );
--
2.9.1
More information about the vlc-devel
mailing list