Merge pull request #1279 from OxygenCobalt/copilot/fix-r128-gain-zero-issue
Fix R128_*_GAIN Opus fields containing 0 should not be ignored
This commit is contained in:
@@ -267,7 +267,7 @@ internal fun Metadata.replayGainAlbumAdjustment() =
|
||||
?: id3v2["TXXX:REPLAYGAIN_ALBUM_GAIN"]?.parseReplayGainAdjustment())
|
||||
|
||||
private fun List<String>.parseR128Adjustment() =
|
||||
first().replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "").toFloatOrNull()?.nonZeroOrNull()?.run {
|
||||
first().replace(REPLAYGAIN_ADJUSTMENT_FILTER_REGEX, "").toFloatOrNull()?.run {
|
||||
// Convert to fixed-point and adjust to LUFS 18 to match the ReplayGain scale
|
||||
this / 256f + 5
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user