diff options
author | wm4 <wm4@nowhere> | 2016-07-11 11:03:31 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-11 11:03:36 +0200 |
commit | 61afe3820a9e967a471e6ef90162158f5cf87f39 (patch) | |
tree | 1f119f8bc8bed12bd7b21f9b3549ebfdf1c47c4b /audio | |
parent | 60048b7eb957bbe09b9c42d11ed61911939b0553 (diff) | |
download | mpv-61afe3820a9e967a471e6ef90162158f5cf87f39.tar.bz2 mpv-61afe3820a9e967a471e6ef90162158f5cf87f39.tar.xz |
af_volume: don't let softvol overwrite af_volume volumedb sub-option
af_volume has a volumedb sub-option, which allows the user to set an
explicit volume. Until recently, the player read back this value and
used it as initial softvol volume. But now it just overwrites it.
Instead of overwriting it, multiply the different gain values. Above
all, this will do the right thing if only softvol is used, or if the
user only adds the af_volume filter manually.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_volume.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/filter/af_volume.c b/audio/filter/af_volume.c index 7bd7edd66d..20031961b4 100644 --- a/audio/filter/af_volume.c +++ b/audio/filter/af_volume.c @@ -115,7 +115,7 @@ static void filter_plane(struct af_instance *af, struct mp_audio *data, int p) { struct priv *s = af->priv; - float level = s->level * s->rgain; + float level = s->level * s->rgain * from_dB(s->cfg_volume, 20.0, -200.0, 60.0); int num_samples = data->samples * data->spf; if (af_fmt_from_planar(af->data->format) == AF_FORMAT_S16) { @@ -158,7 +158,7 @@ static int af_open(struct af_instance *af) struct priv *s = af->priv; af->control = control; af->filter_frame = filter; - s->level = from_dB(s->cfg_volume, 20.0, -200.0, 60.0); + s->level = 1.0; return AF_OK; } |