Commit f9356758 authored by Wim Taymans's avatar Wim Taymans
Browse files

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
parent 73f5e4fe
2006-04-28 Wim Taymans <wim@fluendo.com>
* gst/audioconvert/audioconvert.c: (float):
correctly clip float samples > 1.0. Fixes #338718
2006-04-28 Tim-Philipp Müller <tim at centricular dot net>
 
Patch by: Young-Ho Cha <ganadist at chollian net>
......
......@@ -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);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment