From 336c3821fc0326b180f57d8105b236ee3eab657d Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Mon, 14 Jul 2014 19:24:04 +0300 Subject: [PATCH] Corrected a math mistake in obs_source.c calc_volume_levels. --- libobs/obs-source.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 44e0dc589..6f2e9c30d 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -565,8 +565,8 @@ static void calc_volume_levels(struct obs_source *source, float *array, max_val = fmaxf(max_val, val_pow2); } - rms_val = to_db(sqrtf(sum_val / (float)count * volume)); - max_val = to_db(sqrtf(max_val * volume)); + rms_val = to_db(sqrtf(sum_val / (float)count) * volume); + max_val = to_db(sqrtf(max_val) * volume); if (max_val > source->vol_max) source->vol_max = max_val;