diff --git a/modules/juce_audio_devices/native/juce_HighPerformanceAudioHelpers_android.h b/modules/juce_audio_devices/native/juce_HighPerformanceAudioHelpers_android.h index c76f96d6e9..7f93f9f7ea 100644 --- a/modules/juce_audio_devices/native/juce_HighPerformanceAudioHelpers_android.h +++ b/modules/juce_audio_devices/native/juce_HighPerformanceAudioHelpers_android.h @@ -65,7 +65,7 @@ namespace AndroidHighPerformanceAudioHelpers static bool canUseHighPerformanceAudioPath (int nativeBufferSize, int requestedBufferSize, int requestedSampleRate) { return ((requestedBufferSize % nativeBufferSize) == 0) - && (requestedSampleRate == getNativeSampleRate()) + && approximatelyEqual ((double) requestedSampleRate, getNativeSampleRate()) && isProAudioDevice(); } diff --git a/modules/juce_dsp/native/juce_SIMDNativeOps_fallback.h b/modules/juce_dsp/native/juce_SIMDNativeOps_fallback.h index 595e02e049..22d1917a62 100644 --- a/modules/juce_dsp/native/juce_SIMDNativeOps_fallback.h +++ b/modules/juce_dsp/native/juce_SIMDNativeOps_fallback.h @@ -147,7 +147,7 @@ struct SIMDFallbackOps UnionType a {av}, b {bv}; for (size_t i = 0; i < n; ++i) - if (a.s[i] != b.s[i]) + if (! exactlyEqual (a.s[i], b.s[i])) return false; return true; @@ -181,8 +181,8 @@ struct SIMDFallbackOps struct ScalarOr { static forcedinline MaskType op (MaskType a, MaskType b) noexcept { return a | b; } }; struct ScalarXor { static forcedinline MaskType op (MaskType a, MaskType b) noexcept { return a ^ b; } }; struct ScalarNot { static forcedinline MaskType op (MaskType a, MaskType b) noexcept { return (~a) & b; } }; - struct ScalarEq { static forcedinline bool op (ScalarType a, ScalarType b) noexcept { return (a == b); } }; - struct ScalarNeq { static forcedinline bool op (ScalarType a, ScalarType b) noexcept { return (a != b); } }; + struct ScalarEq { static forcedinline bool op (ScalarType a, ScalarType b) noexcept { return exactlyEqual (a, b); } }; + struct ScalarNeq { static forcedinline bool op (ScalarType a, ScalarType b) noexcept { return ! exactlyEqual (a, b); } }; struct ScalarGt { static forcedinline bool op (ScalarType a, ScalarType b) noexcept { return (a > b); } }; struct ScalarGeq { static forcedinline bool op (ScalarType a, ScalarType b) noexcept { return (a >= b); } }; diff --git a/modules/juce_video/native/juce_Video_android.h b/modules/juce_video/native/juce_Video_android.h index 56d94bbb9a..0ffc092c3b 100644 --- a/modules/juce_video/native/juce_Video_android.h +++ b/modules/juce_video/native/juce_Video_android.h @@ -921,7 +921,7 @@ private: auto* env = getEnv(); // Perform a potentially pending volume setting - if (lastAudioVolume != std::numeric_limits::min()) + if (! exactlyEqual (lastAudioVolume, std::numeric_limits::min())) env->CallVoidMethod (nativeMediaPlayer, AndroidMediaPlayer.setVolume, (jfloat) lastAudioVolume, (jfloat) lastAudioVolume); env->CallVoidMethod (nativeMediaPlayer, AndroidMediaPlayer.start);