Skip to content

Commit

Permalink
Set Voice.Ready to False when opusSender exits :)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwmarrin committed Jan 27, 2016
1 parent 7a7848d commit 99351be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion voice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down

0 comments on commit 99351be

Please sign in to comment.