From f9356758c8f74b4288277b4837c3739b2b3e6252 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 28 Apr 2006 14:12:28 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ gst/audioconvert/audioconvert.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) 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); } } -- 2.7.4