mirror of
https://gitlab.com/comunic/ComunicRTCProxy
synced 2024-12-25 21:18:53 +00:00
Improve performances
This commit is contained in:
parent
6e07514c44
commit
f5d4e160b1
6
relay.go
6
relay.go
@ -196,7 +196,6 @@ func newCall(mainOffer receivedSignal, r *activeRelay) {
|
||||
// I am not sure this is a strong way to determine whether we are having
|
||||
// a video call or not, but I have not found any better way yet...
|
||||
isVideoCall := strings.Contains(mainOffer.sdp.SDP, "m=video") || strings.Contains(mainOffer.sdp.SDP, "mid:video")
|
||||
print(mainOffer.sdp.SDP)
|
||||
numberTracks := 1
|
||||
if isVideoCall {
|
||||
numberTracks = 2
|
||||
@ -427,11 +426,14 @@ func newCall(mainOffer receivedSignal, r *activeRelay) {
|
||||
|
||||
// First, we must make sure that we got all the tracks we need, before
|
||||
// creating an offer (in order not to miss a track while building the offer)
|
||||
stopCheck := len(localTracks) >= numberTracks // Stop check if we got all the channel
|
||||
stopCheck := len(localTracks) >= numberTracks // Stop check if we got all the channels
|
||||
for !stopCheck {
|
||||
select {
|
||||
case t := <-localTrackChan:
|
||||
localTracks = append(localTracks, t)
|
||||
if len(localTracks) >= numberTracks {
|
||||
stopCheck = true
|
||||
}
|
||||
case <-time.After(time.Millisecond * 1000):
|
||||
stopCheck = true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user