mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-27 11:32:51 +00:00
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:
parent
73f5e4fe62
commit
f9356758c8
2 changed files with 8 additions and 3 deletions
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue