]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
make use of max_db
authorDavid Leibovic <david.leibovic@gmail.com>
Sat, 8 Jul 2023 00:19:34 +0000 (20:19 -0400)
committerGitHub <noreply@github.com>
Sat, 8 Jul 2023 00:19:34 +0000 (20:19 -0400)
common.c

index f9b83b8d76d7c47857cb9b1345c654c48d112d9c..6e3e4ab072ef6061b298a6d14975917038675a3c 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1216,7 +1216,7 @@ double logarithmic_vol2attn(double vol, long max_db, long min_db) {
       return min_db;
     }
 
-    vol_setting = 1000 * log10(vol_pct) / log10(2); // This will be in the range [-inf, 0]
+    vol_setting = max_db + 1000 * log10(vol_pct) / log10(2); // This will be in the range [-inf, max_db]
     if (vol_setting < min_db) {
       return min_db;
     }