From: Wim Taymans Date: Fri, 28 Apr 2006 14:12:28 +0000 (+0000) Subject: gst/audioconvert/audioconvert.c: correctly clip float samples > 1.0. Fixes #338718 X-Git-Tag: 1.19.3~511^2~11984 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9356758c8f74b4288277b4837c3739b2b3e6252;p=platform%2Fupstream%2Fgstreamer.git gst/audioconvert/audioconvert.c: correctly clip float samples > 1.0. Fixes #338718 Original commit message from CVS: * gst/audioconvert/audioconvert.c: (float): correctly clip float samples > 1.0. Fixes #338718 --- diff --git a/ChangeLog b/ChangeLog index 163def2..c3a376b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-28 Wim Taymans + + * gst/audioconvert/audioconvert.c: (float): + correctly clip float samples > 1.0. Fixes #338718 + 2006-04-28 Tim-Philipp Müller Patch by: Young-Ho Cha diff --git a/gst/audioconvert/audioconvert.c b/gst/audioconvert/audioconvert.c index 7531e69..d689592 100644 --- a/gst/audioconvert/audioconvert.c +++ b/gst/audioconvert/audioconvert.c @@ -58,11 +58,11 @@ MAKE_UNPACK_FUNC_NAME (float) (gpointer src, gint32 * dst, gint scale, gint count) { gfloat *p = (gfloat *) src; - gfloat temp; + gint64 temp; for (; count; count--) { - temp = *p++ * 2147483647.0f + .5; - *dst++ = (gint32) CLAMP (temp, G_MININT, G_MAXINT); + temp = *p++ * 2147483647.0f; + *dst++ = (gint32) CLAMP (temp, G_MININT32, G_MAXINT32); } }