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:
Alexander Capehart
2026-01-10 18:54:17 -07:00
committed by GitHub
2 changed files with 11 additions and 1 deletions
@@ -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
}