summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_volume.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/filter/af_volume.c')
-rw-r--r--audio/filter/af_volume.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/filter/af_volume.c b/audio/filter/af_volume.c
index f07914313b..f9f4a4ac40 100644
--- a/audio/filter/af_volume.c
+++ b/audio/filter/af_volume.c
@@ -79,7 +79,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
if (!s->rgain_clip) // clipping prevention
s->rgain = MPMIN(s->rgain, 1.0 / peak);
}
- if (s->detach && fabs(s->level + s->rgain - 2.0) < 0.00001)
+ if (s->detach && fabs(s->level * s->rgain - 1.0) < 0.00001)
return AF_DETACH;
return af_test_output(af, in);
}
@@ -97,7 +97,7 @@ static void filter_plane(struct af_instance *af, void *ptr, int num_samples)
{
struct priv *s = af->priv;
- float level = s->level + s->rgain - 1.0;
+ float level = s->level * s->rgain;
if (af_fmt_from_planar(af->data->format) == AF_FORMAT_S16) {
int16_t *a = ptr;