From 6b91c5f6e765e8522199d6b33b23dfd3d69d06b1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 5 Jan 2011 15:03:32 +0100 Subject: [PATCH] vrawdepay: fix length check Add some more debugging. Add the length check so we don't cause unneeded warnings. --- gst/rtp/gstrtpvrawdepay.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/rtp/gstrtpvrawdepay.c b/gst/rtp/gstrtpvrawdepay.c index 8e1af75e72..5919a5bcb0 100644 --- a/gst/rtp/gstrtpvrawdepay.c +++ b/gst/rtp/gstrtpvrawdepay.c @@ -242,6 +242,7 @@ gst_rtp_vraw_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps) GST_DEBUG_OBJECT (depayload, "width %d, height %d, format %d", width, height, format); GST_DEBUG_OBJECT (depayload, "yp %d, up %d, vp %d", yp, up, vp); + GST_DEBUG_OBJECT (depayload, "xinc %d, yinc %d", xinc, yinc); GST_DEBUG_OBJECT (depayload, "pgroup %d, ystride %d, uvstride %d", pgroup, ystride, uvstride); GST_DEBUG_OBJECT (depayload, "outsize %u", outsize); @@ -386,10 +387,10 @@ gst_rtp_vraw_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) } /* calculate the maximim amount of bytes we can use per line */ - if (offs + ((length / pgroup) * xinc) > (width - xinc)) { + if (offs + ((length / pgroup) * xinc) > width) { plen = ((width - offs) * pgroup) / xinc; - GST_WARNING_OBJECT (depayload, "clipping length %d, offset %d", length, - offs); + GST_WARNING_OBJECT (depayload, "clipping length %d, offset %d, plen %d", + length, offs, plen); } else plen = length;