summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2023-12-17 14:43:38 -0500
committerDudemanguy <random342@airmail.cc>2024-01-20 16:08:33 +0000
commitf04727145bf0e7c651e08592360fb22a101d3f43 (patch)
tree423d48817b5657884b4b805f8c6c1395f32f3fcb /player/audio.c
parent0f2370476b4279040261878c601fb8015a8502d7 (diff)
downloadmpv-f04727145bf0e7c651e08592360fb22a101d3f43.tar.bz2
mpv-f04727145bf0e7c651e08592360fb22a101d3f43.tar.xz
audio: add --volume-gain options to control volume in decibels
This adds volume-gain, volume-gain-max, volume-gain-min options, which can be used to control audio volume and target dynamic range in decibels. The gain is applied on top of the existing volume setting.
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/audio.c b/player/audio.c
index ca17d3325b..344fbdb744 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -175,6 +175,7 @@ void audio_update_volume(struct MPContext *mpctx)
float gain = MPMAX(opts->softvol_volume / 100.0, 0);
gain = pow(gain, 3);
gain *= compute_replaygain(mpctx);
+ gain *= db_gain(opts->softvol_gain);
if (opts->softvol_mute == 1)
gain = 0.0;