aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm/PcmMix.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-30 17:23:49 +0100
committerMax Kellermann <max@duempel.org>2013-10-30 17:23:49 +0100
commit50dc98367ccb6155a15c440df5e32cf2b8b719ea (patch)
treebcdbaf115194ca473916f644c3492494280b8834 /src/pcm/PcmMix.cxx
parentc4d3030d24d25f7fa8ea30fc108dc7df415fbc02 (diff)
downloadmpd-50dc98367ccb6155a15c440df5e32cf2b8b719ea.tar.gz
mpd-50dc98367ccb6155a15c440df5e32cf2b8b719ea.tar.xz
mpd-50dc98367ccb6155a15c440df5e32cf2b8b719ea.zip
PcmMix: use negative value instead of NaN for addition
Avoid NaN to allow -ffast-math.
Diffstat (limited to 'src/pcm/PcmMix.cxx')
-rw-r--r--src/pcm/PcmMix.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pcm/PcmMix.cxx b/src/pcm/PcmMix.cxx
index f4a02fc47..d3b0f3e2b 100644
--- a/src/pcm/PcmMix.cxx
+++ b/src/pcm/PcmMix.cxx
@@ -194,9 +194,9 @@ pcm_mix(void *buffer1, const void *buffer2, size_t size,
int vol1;
float s;
- /* portion1 is between 0.0 and 1.0 for crossfading, MixRamp uses NaN
+ /* portion1 is between 0.0 and 1.0 for crossfading, MixRamp uses -1
* to signal mixing rather than fading */
- if (isnan(portion1))
+ if (portion1 < 0)
return pcm_add(buffer1, buffer2, size, format);
s = sin(M_PI_2 * portion1);