From 659b872dbc200130b2ca71eb080b7ee52c41d9ef Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 22 Jul 2013 19:00:00 +0200 Subject: [PATCH] vf_split fix --- src/vf_split.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vf_split.c b/src/vf_split.c index bdc6b185b..3958258f3 100644 --- a/src/vf_split.c +++ b/src/vf_split.c @@ -66,6 +66,7 @@ void vf_split(struct video_frame *out, struct video_frame *src, struct tile *cur_tiles; unsigned int tile_line = 0; int out_linesize; + int src_linesize; out->color_spec = src->color_spec; out->fps = src->fps; @@ -73,6 +74,9 @@ void vf_split(struct video_frame *out, struct video_frame *src, assert(vf_get_tile(src, 0)->width % x_count == 0u && vf_get_tile(src, 0)->height % y_count == 0u); + src_linesize = vc_get_linesize(src->tiles[0].width, + src->color_spec); + for(tile_idx = 0u; tile_idx < x_count * y_count; ++tile_idx) { out->tiles[tile_idx].width = vf_get_tile(src, 0)->width / x_count; out->tiles[tile_idx].height = vf_get_tile(src, 0)->height / y_count; @@ -107,7 +111,7 @@ void vf_split(struct video_frame *out, struct video_frame *src, tile_line * out_linesize], (void *) &src->tiles[0].data[line_idx * - out_linesize + byte], + src_linesize + byte], cur_tiles[cur_tile_idx].width * get_bpp(src->color_spec)); byte += cur_tiles[cur_tile_idx].width * get_bpp(src->color_spec);