summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2010-12-05 19:03:18 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2010-12-05 19:03:18 +0530
commit0317f5e59b4cfeaa56b9a3d356a086a999fb6a1c (patch)
treed9e4331f7be0442c857fd562cd1b7b5ea00a17de
parent933eba8a03f57376774de50c3fcf8659c9211bfc (diff)
volume: 20 dB should be enough for anyone
This limits the maximum gain we perform in software to approximately 20 dB. There does not appear to be a good reason for greater gain, and clipping to 20 dB can prevent accidentally setting an absurdly large volume and potential damage to the ears.
-rw-r--r--src/pulse/volume.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pulse/volume.h b/src/pulse/volume.h
index 35128b634..d646a7bc1 100644
--- a/src/pulse/volume.h
+++ b/src/pulse/volume.h
@@ -113,7 +113,8 @@ typedef uint32_t pa_volume_t;
#define PA_VOLUME_MUTED ((pa_volume_t) 0U)
/** Maximum valid volume we can store. \since 0.9.15 */
-#define PA_VOLUME_MAX ((pa_volume_t) UINT32_MAX/2)
+/* This value corresponds to ~20 dB (of software amplification) */
+#define PA_VOLUME_MAX ((pa_volume_t) 141193)
/** Special 'invalid' volume. \since 0.9.16 */
#define PA_VOLUME_INVALID ((pa_volume_t) UINT32_MAX)