mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
controller: use NAN instead of FP_NAN (which is the class)
Also add a fallback define to math-compat.h. Fixes #666887
This commit is contained in:
parent
e136cc334f
commit
eba636cc83
3 changed files with 25 additions and 9 deletions
|
@ -79,6 +79,24 @@ __gst_math_compat_rintf (float x)
|
|||
#define rintf(x) __gst_math_compat_rintf(x)
|
||||
#endif
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
#define __gst_nan_bytes { 0x7f, 0xc0, 0, 0 }
|
||||
#endif
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
#define __gst_nan_bytes { 0, 0, 0xc0, 0x7f }
|
||||
#endif
|
||||
|
||||
static union {
|
||||
unsigned char __c[4];
|
||||
float __d;
|
||||
} __gst_nan_union __attribute_used__ = {
|
||||
__gst_nan_bytes
|
||||
};
|
||||
|
||||
#ifndef NAN
|
||||
#define NAN (__gst_nan_union.__d)
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_MATH_COMPAT_H__ */
|
||||
|
|
|
@ -41,8 +41,7 @@
|
|||
|
||||
#include "gstinterpolationcontrolsource.h"
|
||||
#include "gst/glib-compat-private.h"
|
||||
|
||||
#include <math.h>
|
||||
#include "gst/math-compat.h"
|
||||
|
||||
#define GST_CAT_DEFAULT controller_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
@ -90,7 +89,7 @@ interpolate_none_get_value_array (GstTimedValueControlSource * self,
|
|||
|
||||
g_mutex_lock (self->lock);
|
||||
for (i = 0; i < n_values; i++) {
|
||||
val = FP_NAN;
|
||||
val = NAN;
|
||||
if (ts >= next_ts) {
|
||||
iter1 = gst_timed_value_control_source_find_control_point_iter (self, ts);
|
||||
if (!iter1) {
|
||||
|
@ -189,7 +188,7 @@ interpolate_linear_get_value_array (GstTimedValueControlSource * self,
|
|||
g_mutex_lock (self->lock);
|
||||
|
||||
for (i = 0; i < n_values; i++) {
|
||||
val = FP_NAN;
|
||||
val = NAN;
|
||||
if (ts >= next_ts) {
|
||||
cp1 = cp2 = NULL;
|
||||
iter1 = gst_timed_value_control_source_find_control_point_iter (self, ts);
|
||||
|
@ -403,7 +402,7 @@ interpolate_cubic_get_value_array (GstTimedValueControlSource * self,
|
|||
g_mutex_lock (self->lock);
|
||||
|
||||
for (i = 0; i < n_values; i++) {
|
||||
val = FP_NAN;
|
||||
val = NAN;
|
||||
if (ts >= next_ts) {
|
||||
cp1 = cp2 = NULL;
|
||||
iter1 = gst_timed_value_control_source_find_control_point_iter (self, ts);
|
||||
|
|
|
@ -41,8 +41,7 @@
|
|||
|
||||
#include "gsttriggercontrolsource.h"
|
||||
#include "gst/glib-compat-private.h"
|
||||
|
||||
#include <math.h>
|
||||
#include "gst/math-compat.h"
|
||||
|
||||
#define GST_CAT_DEFAULT controller_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
@ -79,7 +78,7 @@ _interpolate_trigger (GstTimedValueControlSource * self, GSequenceIter * iter,
|
|||
if (found) {
|
||||
return cp->value;
|
||||
}
|
||||
return FP_NAN;
|
||||
return NAN;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -117,7 +116,7 @@ interpolate_trigger_get_value_array (GstTimedValueControlSource * self,
|
|||
|
||||
g_mutex_lock (self->lock);
|
||||
for (i = 0; i < n_values; i++) {
|
||||
val = FP_NAN;
|
||||
val = NAN;
|
||||
if (ts >= next_ts) {
|
||||
iter1 = gst_timed_value_control_source_find_control_point_iter (self, ts);
|
||||
if (!iter1) {
|
||||
|
|
Loading…
Reference in a new issue