From aa35b26ae61eb4639cced264a53d05ab2ab2fa07 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Tue, 16 Jun 2026 05:25:16 +0200 Subject: [PATCH] libmpv: allow volume boost up to 130% (fix volume clamped at 100) The volume slider and VolumeMaximum advertise a maximum of 130, but the LibMpvDynamicPlayer.Volume setter clamped the value to 100 before passing it to mpv. This made the top of the slider (100..130) a no-op, so users could never amplify audio above unity gain. mpv's default volume-max is 130 (== MaxVolume), so clamping to MaxVolume instead of 100 enables the intended boost range. Relates to #11647. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/Logic/VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs b/src/ui/Logic/VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs index d045a2a169e..78483a7e842 100644 --- a/src/ui/Logic/VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs +++ b/src/ui/Logic/VideoPlayers/LibMpvDynamic/LibMpvDynamicPlayer.cs @@ -1155,8 +1155,11 @@ public double Volume return; } - // Clamp volume between 0 and 100 - var clampedVolume = Math.Max(0, Math.Min(100, value)); + // Clamp volume between 0 and the player maximum. mpv's default + // volume-max is 130, matching MaxVolume, so values above 100 boost + // (amplify) the audio. Clamping to 100 here meant the upper part of + // the volume slider (100..130) did nothing. + var clampedVolume = Math.Max(0, Math.Min(MaxVolume, value)); var err = DoMpvCommand("set", "volume", clampedVolume.ToString(CultureInfo.InvariantCulture)); //if (err < 0) //{