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:
Michael Smith 2006-06-02 14:19:18 +00:00
parent 9bfe860234
commit fc30337a99
2 changed files with 7 additions and 2 deletions

View file

@ -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):

View file

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