Skip to content

Commit 40723dd

Browse files
committed
fix: 解决使用音量快捷键设置时静音状态异常的问题
SetMute中判断了音量是否为0,但是Volume是根据事件刷新的,此时还不是设置后的音量,因此会影响判断 Log: PMS: BUG-351645 Influence: audio mute settings
1 parent 4568f27 commit 40723dd

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

audio1/sink.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,15 @@ func (s *Sink) SetVolume(value float64, isPlay bool) *dbus.Error {
111111
value = 0.001
112112
s.setMute(true)
113113
} else {
114-
s.SetMute(false)
114+
// SetMute中判断了音量是否为0,但是Volume是根据事件刷新的,此时还不是设置后的音量,因此会影响判断
115+
if err := s.setMute(false); err == nil {
116+
if GetConfigKeeper().Mute.MuteOutput {
117+
GetConfigKeeper().SetMuteOutput(false)
118+
}
119+
} else {
120+
logger.Warning(err)
121+
}
122+
115123
}
116124
s.PropsMu.Lock()
117125
cv := s.cVolume.SetAvg(value)

0 commit comments

Comments
 (0)