mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
gst/audioconvert/audioconvert.c: More correct float->int conversion.
Original commit message from CVS: * gst/audioconvert/audioconvert.c: (float): More correct float->int conversion.
This commit is contained in:
parent
9bfe860234
commit
fc30337a99
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2006-06-02 Michael Smith <msmith@fluendo.com>
|
||||
|
||||
* gst/audioconvert/audioconvert.c: (float):
|
||||
More correct float->int conversion.
|
||||
|
||||
2006-06-02 Michael Smith <msmith@fluendo.com>
|
||||
|
||||
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_perform_seek):
|
||||
|
|
|
@ -58,10 +58,10 @@ MAKE_UNPACK_FUNC_NAME (float) (gpointer src, gint32 * dst,
|
|||
gint scale, gint count)
|
||||
{
|
||||
gfloat *p = (gfloat *) src;
|
||||
gint64 temp;
|
||||
gdouble temp;
|
||||
|
||||
for (; count; count--) {
|
||||
temp = *p++ * 2147483647.0f;
|
||||
temp = (*p++ * 2147483647.0) + 0.5;
|
||||
*dst++ = (gint32) CLAMP (temp, G_MININT32, G_MAXINT32);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue