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
This commit is contained in:
Wim Taymans 2006-04-28 14:12:28 +00:00
parent 73f5e4fe62
commit f9356758c8
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
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>

View file

@ -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);
}
}