[vlc-devel] [PATCH 3/3] Fix #8165

Anatoliy Anischovich lin.aaa.lin at gmail.com
Fri Mar 8 01:43:03 CET 2013


If there is no peak data, assume peak is equal 1.0.
---
 src/audio_output/volume.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/audio_output/volume.c b/src/audio_output/volume.c
index 7eb977d..b16cc83 100644
--- a/src/audio_output/volume.c
+++ b/src/audio_output/volume.c
@@ -179,10 +179,10 @@ static float aout_ReplayGainSelect(vlc_object_t *obj, const char *str,
 
         multiplier = pow (10., gain / 20.);
 
-        if (replay_gain->pb_peak[mode]
-         && var_InheritBool (obj, "audio-replay-gain-peak-protection")
-         && replay_gain->pf_peak[mode] * multiplier > 1.f)
-            multiplier = 1.f / replay_gain->pf_peak[mode];
+        if (var_InheritBool (obj, "audio-replay-gain-peak-protection"))
+            multiplier = fminf (multiplier, replay_gain->pb_peak[mode]
+                                            ? 1.f / replay_gain->pf_peak[mode]
+                                            : 1.f);
     }
 
     /* Command line / configuration gain */
-- 
1.8.1.5




More information about the vlc-devel mailing list