From 5744b7995c8361cc1e481aed1bf0e0f853ed312b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 24 Feb 2015 17:20:53 +0100 Subject: [PATCH] video-converter: fix chroma subsampling Also adjust the output line number with the offset. --- gst-libs/gst/video/video-converter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index 097364e01f..9eda3f4889 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -2161,8 +2161,8 @@ get_dest_line (GstLineCache * cache, gint idx, gpointer user_data) cline = CLAMP (idx, 0, convert->out_maxheight - 1); - GST_DEBUG ("get dest line %d", cline); line = FRAME_GET_LINE (convert->dest, cline); + GST_DEBUG ("get dest line %d %p", cline, line); if (convert->borderline) { gint r_border = (out_x + convert->out_width) * pstride; @@ -2212,8 +2212,10 @@ do_upsample_lines (GstLineCache * cache, gint out_line, gint in_line, n_lines = convert->up_n_lines; start_line = in_line; - if (start_line < n_lines + convert->up_offset) + if (start_line < n_lines + convert->up_offset) { start_line += convert->up_offset; + out_line += convert->up_offset; + } /* get the lines needed for chroma upsample */ lines = gst_line_cache_get_lines (cache->prev, out_line, start_line, n_lines);