Serialize OpenAL playback on a dedicated thread

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 12:55:55 -04:00
committed by Brandon McGinty
parent 0f2eb4408f
commit 8c0887d562
4 changed files with 105 additions and 62 deletions
+3 -15
View File
@@ -27,7 +27,7 @@ type Barnard struct {
Address string
TLSConfig tls.Config
Stream *gumbleopenal.Stream
Stream *gumbleopenal.Stream
Tx bool
AutoTransmit bool // auto-start transmission on connect
Connected bool
@@ -136,13 +136,7 @@ func (b *Barnard) TreeItemKeyPress(ui *uiterm.Ui, tree *uiterm.Tree, item uiterm
b.UserConfig.ToggleMute(u)
}
if au := u.AudioSource(); au != nil {
if u.LocallyMuted() {
au.SetGain(0)
} else {
au.SetGain(u.Volume())
}
}
b.Stream.UpdateUserGain(u)
}
// Update channel mute state
@@ -174,13 +168,7 @@ func (b *Barnard) TreeItemKeyPress(ui *uiterm.Ui, tree *uiterm.Tree, item uiterm
if key == *b.Hotkeys.MuteToggle {
// Toggle mute for single user
b.UserConfig.ToggleMute(treeItem.User)
if au := treeItem.User.AudioSource(); au != nil {
if treeItem.User.LocallyMuted() {
au.SetGain(0)
} else {
au.SetGain(treeItem.User.Volume())
}
}
b.Stream.UpdateUserGain(treeItem.User)
b.RebuildUserChannelTreePreservingSelection()
b.Ui.Refresh()
}