Skip to content

libmpv: allow volume boost up to 130% (fix volume clamped at 100)#11649

Merged
niksedk merged 1 commit into
mainfrom
fix/mpv-volume-clamp-130
Jun 16, 2026
Merged

libmpv: allow volume boost up to 130% (fix volume clamped at 100)#11649
niksedk merged 1 commit into
mainfrom
fix/mpv-volume-clamp-130

Conversation

@niksedk

@niksedk niksedk commented Jun 16, 2026

Copy link
Copy Markdown
Member

Problem

The volume slider and LibMpvDynamicPlayer.VolumeMaximum/MaxVolume advertise a maximum of 130, but the Volume setter clamped the value to 100 before handing it to mpv:

// Clamp volume between 0 and 100
var clampedVolume = Math.Max(0, Math.Min(100, value));

So the upper part of the slider (100..130) was a no-op — mpv never received anything above unity gain, and users could not amplify audio above the source's natural level. (The LibVlcDynamicPlayer path already scales correctly to its 130 max; only the mpv path was wrong.)

Fix

Clamp to MaxVolume instead of the hardcoded 100. mpv's default volume-max is 130 (== MaxVolume), so values above 100 boost (amplify) the audio as intended.

Context

Relates to #11647 (RC4 / Fedora: audio extremely low). This is not a full fix for that report — the underlying "extremely low" baseline there is most likely environmental (PipeWire per-app stream level / multichannel downmix, and embedded libmpv not loading the user's mpv.conf). But the clamp meant SubtitleEdit users had no way to compensate above unity gain even though the UI offered it. This restores the intended boost headroom.

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@niksedk niksedk merged commit 908da73 into main Jun 16, 2026
1 of 3 checks passed
@niksedk niksedk deleted the fix/mpv-volume-clamp-130 branch June 16, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant