From 39708f9831926d5eaa90e5451adf27fe124d4153 Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat@gmail.com>
Date: Fri, 18 Feb 2022 07:02:38 -0800
Subject: Avoid a variable limit on EAX filters

I'll assume for now that the limits for the EAX properties will keep the filter
gain from getting out of hand. The filter's gainhf is relative to the gain and
is limited to 0dB max.
---
 al/source.cpp | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

(limited to 'al/source.cpp')

diff --git a/al/source.cpp b/al/source.cpp
index 59ce5549..4be5045b 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -3894,12 +3894,10 @@ EaxAlLowPassParam ALsource::eax_create_direct_filter_param() const noexcept
         }
     }
 
-    const auto max_gain = eax_al_context_->eax_get_max_filter_gain();
-
     const auto al_low_pass_param = EaxAlLowPassParam
     {
-        clamp(level_mb_to_gain(gain_mb), 0.0F, max_gain),
-        clamp(level_mb_to_gain(gain_hf_mb), 0.0F, max_gain)
+        level_mb_to_gain(gain_mb),
+        minf(level_mb_to_gain(gain_hf_mb), 1.0f)
     };
 
     return al_low_pass_param;
@@ -3947,12 +3945,10 @@ EaxAlLowPassParam ALsource::eax_create_room_filter_param(
 
         0.0F;
 
-    const auto max_gain = eax_al_context_->eax_get_max_filter_gain();
-
     const auto al_low_pass_param = EaxAlLowPassParam
     {
-        clamp(level_mb_to_gain(gain_mb), 0.0F, max_gain),
-        clamp(level_mb_to_gain(gain_hf_mb), 0.0F, max_gain)
+        level_mb_to_gain(gain_mb),
+        minf(level_mb_to_gain(gain_hf_mb), 1.0f)
     };
 
     return al_low_pass_param;
-- 
cgit v1.2.3