Moved Voice.Ready = true into opusSender

This commit is contained in:
Bruce Marriner 2016-01-26 21:42:37 -06:00
parent 4b1baec757
commit 7cc7b09957

View file

@ -355,7 +355,6 @@ func (v *Voice) udpOpen() (err error) {
go v.udpKeepAlive(5 * time.Second) go v.udpKeepAlive(5 * time.Second)
// TODO: find a way to check that it fired off okay // TODO: find a way to check that it fired off okay
v.Ready = true
return return
} }
@ -399,6 +398,10 @@ func (v *Voice) opusSender(opus <-chan []byte, rate, size int) {
runtime.LockOSThread() runtime.LockOSThread()
// Voice is now ready to receive audio packets
// TODO: this needs reviewed as I think there must be a better way.
v.Ready = true
var sequence uint16 = 0 var sequence uint16 = 0
var timestamp uint32 = 0 var timestamp uint32 = 0
udpHeader := make([]byte, 12) udpHeader := make([]byte, 12)