From ab854b04baaa56a2309b258c602d1cadd7e45e74 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 15 Feb 2017 21:41:47 +0200 Subject: [PATCH] video-scaler: Fix upscaling if width & height change and we're starting not at y=0 It was taking the initial input y-offset from the output value, which only works for y=0 (in which case both are the same). If y > 0, we would always stay behind the requested input offset and never ever read anything from the input. --- gst-libs/gst/video/video-scaler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video-scaler.c b/gst-libs/gst/video/video-scaler.c index 1dbae03..cd100c8 100644 --- a/gst-libs/gst/video/video-scaler.c +++ b/gst-libs/gst/video/video-scaler.c @@ -1505,7 +1505,6 @@ gst_video_scaler_2d (GstVideoScaler * hscale, GstVideoScaler * vscale, vfunc (vscale, lines, LINE (dest, dest_stride, i), i, width, n_elems); } } else { - gint tmp_in = y; gint s1, s2; if (hscale->tmpwidth < width) @@ -1515,6 +1514,8 @@ gst_video_scaler_2d (GstVideoScaler * hscale, GstVideoScaler * vscale, s2 = width * height; if (s1 <= s2) { + gint tmp_in = vscale->resampler.offset[y]; + for (i = y; i < height; i++) { guint in, j; -- 2.7.4