Skip to content

Commit 30d9c96

Browse files
Fix volume jumping to 100% by keeping saved volume after restoration
Co-authored-by: YimingZhanshen <76594627+YimingZhanshen@users.noreply.github.com>
1 parent 89a00f1 commit 30d9c96

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/Core/GlobalMedia_win.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,12 @@ void Controller::SetVolume(int percent)
595595

596596
// Calculate target volume
597597
int targetPercent;
598-
if (percent == 100 && hasVolumeReduction && _inReductionSession) {
599-
// Restoring - use saved volume and clear the session
598+
if (percent == 100 && hasVolumeReduction) {
599+
// Restoring - use saved volume
600+
// Keep _savedVolume to handle duplicate restoration calls
601+
// It will be cleared when the next reduction cycle starts
600602
targetPercent = _savedVolume;
601603
_inReductionSession = false;
602-
_savedVolume = 0; // Clear saved volume after restoration
603604
LOG(Trace, "SetVolume: Restoring to saved volume {}%, ending session", targetPercent);
604605
} else if (isReducing && _savedVolume > 0) {
605606
// Reducing - calculate relative to saved volume

0 commit comments

Comments
 (0)