From 99351beaf0d2f5310997c107c263df15e7b729d1 Mon Sep 17 00:00:00 2001 From: Bruce Marriner Date: Wed, 27 Jan 2016 10:16:10 -0600 Subject: [PATCH] Set Voice.Ready to False when opusSender exits :) --- voice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voice.go b/voice.go index 6ece6e877..5791480b9 100644 --- a/voice.go +++ b/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 }