forked from pothtonswer/discordmuffin
Set Voice.Ready to False when opusSender exits :)
This commit is contained in:
parent
7a7848d7ff
commit
99351beaf0
1 changed files with 1 additions and 1 deletions
2
voice.go
2
voice.go
|
@ -401,6 +401,7 @@ func (v *Voice) opusSender(opus <-chan []byte, rate, size int) {
|
|||
// Voice is now ready to receive audio packets
|
||||
// TODO: this needs reviewed as I think there must be a better way.
|
||||
v.Ready = true
|
||||
defer func() { v.Ready = false }()
|
||||
|
||||
var sequence uint16 = 0
|
||||
var timestamp uint32 = 0
|
||||
|
@ -422,7 +423,6 @@ func (v *Voice) opusSender(opus <-chan []byte, rate, size int) {
|
|||
// Get data from chan. If chan is closed, return.
|
||||
recvbuf, ok := <-opus
|
||||
if !ok {
|
||||
v.Ready = false
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue