mirror of
https://gitlab.com/comunic/ComunicRTCProxy
synced 2024-12-26 13:38:55 +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
|
// 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...
|
// 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")
|
isVideoCall := strings.Contains(mainOffer.sdp.SDP, "m=video") || strings.Contains(mainOffer.sdp.SDP, "mid:video")
|
||||||
print(mainOffer.sdp.SDP)
|
|
||||||
numberTracks := 1
|
numberTracks := 1
|
||||||
if isVideoCall {
|
if isVideoCall {
|
||||||
numberTracks = 2
|
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
|
// 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)
|
// 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 {
|
for !stopCheck {
|
||||||
select {
|
select {
|
||||||
case t := <-localTrackChan:
|
case t := <-localTrackChan:
|
||||||
localTracks = append(localTracks, t)
|
localTracks = append(localTracks, t)
|
||||||
|
if len(localTracks) >= numberTracks {
|
||||||
|
stopCheck = true
|
||||||
|
}
|
||||||
case <-time.After(time.Millisecond * 1000):
|
case <-time.After(time.Millisecond * 1000):
|
||||||
stopCheck = true
|
stopCheck = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user