Commit a2903253 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Wait for answer before sending data.

parent 47d23658
...@@ -702,13 +702,16 @@ func addDownTrack(c *client, conn *downConnection, remoteTrack *upTrack, remoteC ...@@ -702,13 +702,16 @@ func addDownTrack(c *client, conn *downConnection, remoteTrack *upTrack, remoteC
rate: estimator.New(time.Second), rate: estimator.New(time.Second),
} }
conn.tracks = append(conn.tracks, track) conn.tracks = append(conn.tracks, track)
remoteTrack.addLocal(track)
go rtcpDownListener(conn, track, s) go rtcpDownListener(conn, track, s)
return s, nil return s, nil
} }
func activateDownTrack(conn *downConnection, track *downTrack) {
track.remote.addLocal(track)
}
const ( const (
minLossRate = 9600 minLossRate = 9600
initLossRate = 512 * 1000 initLossRate = 512 * 1000
...@@ -1003,6 +1006,10 @@ func gotAnswer(c *client, id string, answer webrtc.SessionDescription) error { ...@@ -1003,6 +1006,10 @@ func gotAnswer(c *client, id string, answer webrtc.SessionDescription) error {
if err != nil { if err != nil {
return err return err
} }
for _, t := range conn.tracks {
activateDownTrack(conn, t)
}
return nil return nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment