mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
aifmmux: use alternative way to check for inf
MSVC emits a divide-by-zero error when compiling aiffmux.c on line 205. Fixes #623881.
This commit is contained in:
parent
e467a3e14b
commit
3172e11121
1 changed files with 12 additions and 1 deletions
|
@ -183,6 +183,17 @@ typedef struct AVExtFloat
|
|||
guint8 mantissa[8];
|
||||
} AVExtFloat;
|
||||
|
||||
/* Courtesy http://www.devx.com/tips/Tip/42853 */
|
||||
static inline gint
|
||||
gst_aiff_mux_isinf (gdouble x)
|
||||
{
|
||||
volatile gdouble temp = x;
|
||||
if ((temp == x) && ((temp - x) != 0.0))
|
||||
return (x < 0.0 ? -1 : 1);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_aiff_mux_write_ext (GstByteWriter * writer, double d)
|
||||
{
|
||||
|
@ -202,7 +213,7 @@ gst_aiff_mux_write_ext (GstByteWriter * writer, double d)
|
|||
} else if (f != 0.0) {
|
||||
ext.exponent[0] = 0x7f;
|
||||
ext.exponent[1] = 0xff;
|
||||
if (f != 1 / 0.0)
|
||||
if (!gst_aiff_mux_isinf (f))
|
||||
ext.mantissa[0] = ~0;
|
||||
}
|
||||
if (d < 0)
|
||||
|
|
Loading…
Reference in a new issue