Skip to content

Commit

Permalink
fix: 音量为0时直接设置为禁音
Browse files Browse the repository at this point in the history
音量为0时直接设置为禁音

Log: 音量为0时直接设置为禁音
Influence: 调节音量为0
Bug: https://pms.uniontech.com/bug-view-257207.html
Change-Id: If1cf6247787bae47c349f9ba059007ea1028201b
  • Loading branch information
wubw0508 committed May 28, 2024
1 parent 5ab3a0b commit 8df0994
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions audio/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (s *Sink) SetVolume(value float64, isPlay bool) *dbus.Error {

if value == 0 {
value = 0.001
s.SetMute(true)
}
s.PropsMu.Lock()
cv := s.cVolume.SetAvg(value)
Expand Down
1 change: 1 addition & 0 deletions audio/sinkinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (s *SinkInput) SetVolume(value float64, isPlay bool) *dbus.Error {

if value == 0 {
value = 0.001
s.SetMute(true)
}
s.PropsMu.RLock()
cv := s.cVolume.SetAvg(value)
Expand Down

0 comments on commit 8df0994

Please sign in to comment.