From 9647a8ca78c5dff706dcd42542c4a4c890583122 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 19 Nov 2014 13:25:13 +0100 Subject: [PATCH] video-converter: fix size check Add some debug, fix size check that decides what scaling to do first and when to do conversion. --- gst-libs/gst/video/video-converter.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index 2a70ddca49..ae90771a89 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -1118,11 +1118,15 @@ chain_scale (GstVideoConverter * convert, GstLineCache * prev, gboolean force) s0 = convert->current_width * convert->current_height; s3 = convert->out_width * convert->out_height; - if (s0 <= s3 || force) { + GST_DEBUG ("%d <> %d", s0, s3); + + if (s3 <= s0 || force) { /* we are making the image smaller or are forced to resample */ s1 = convert->out_width * convert->current_height; s2 = convert->current_width * convert->out_height; + GST_DEBUG ("%d <> %d", s1, s2); + if (s1 <= s2) { /* h scaling first produces less pixels */ if (convert->current_width != convert->out_width)