diff options
author | Johan Kiviniemi <devel@johan.kiviniemi.name> | 2010-08-23 15:19:16 +0300 |
---|---|---|
committer | Johan Kiviniemi <devel@johan.kiviniemi.name> | 2010-08-23 16:34:11 +0300 |
commit | ed5d297301ad07e1c8f59b25184b4148046c1ebe (patch) | |
tree | 645d6fb1b92f922f123597d1760f2c550bf8d109 /src/filter | |
parent | 92b6ba9eff3b753078ae47a26f91743ddf937357 (diff) | |
download | mpd-ed5d297301ad07e1c8f59b25184b4148046c1ebe.tar.gz mpd-ed5d297301ad07e1c8f59b25184b4148046c1ebe.tar.xz mpd-ed5d297301ad07e1c8f59b25184b4148046c1ebe.zip |
ReplayGain filter: allow gain > 100 %
The ReplayGain filter clamped the gain to max. 100 % even if the
algorithm determined the signal needed a boost. That would result in any
such tracks being played with too low volume, effectively defeating the
purpose of the filter.
Diffstat (limited to 'src/filter')
-rw-r--r-- | src/filter/replay_gain_filter_plugin.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/filter/replay_gain_filter_plugin.c b/src/filter/replay_gain_filter_plugin.c index 4d6080b73..3a0af66ff 100644 --- a/src/filter/replay_gain_filter_plugin.c +++ b/src/filter/replay_gain_filter_plugin.c @@ -55,8 +55,16 @@ struct replay_gain_filter { struct replay_gain_info info; /** - * The current volume, between 0 and #PCM_VOLUME_1 (both - * including). + * The current volume, between 0 and a value that may or may not exceed + * #PCM_VOLUME_1. + * + * If the default value of true is used for replaygain_limit, the + * application of the volume to the signal will never cause clipping. + * + * On the other hand, if the user has set replaygain_limit to false, + * the chance of clipping is explicitly preferred if that's required to + * maintain a consistent audio level. Whether clipping will actually + * occur depends on what value the user is using for replaygain_preamp. */ unsigned volume; @@ -171,7 +179,7 @@ replay_gain_filter_filter(struct filter *_filter, *dest_size_r = src_size; - if (filter->volume >= PCM_VOLUME_1) + if (filter->volume == PCM_VOLUME_1) /* optimized special case: 100% volume = no-op */ return src; |