change ConnClient.Tracks() signature

This commit is contained in:
aler9
2020-11-01 22:09:22 +01:00
parent 551eea72b5
commit ece3dd7077
2 changed files with 8 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ func main() {
defer wg.Wait()
defer conn.CloseUDPListeners()
for trackId := range conn.Tracks() {
for _, track := range conn.Tracks() {
// read RTP frames
wg.Add(1)
go func(trackId int) {
@@ -38,7 +38,7 @@ func main() {
fmt.Printf("frame from track %d, type RTP: %v\n", trackId, buf)
}
}(trackId)
}(track.Id)
// read RTCP frames
wg.Add(1)
@@ -53,7 +53,7 @@ func main() {
fmt.Printf("frame from track %d, type RTCP: %v\n", trackId, buf)
}
}(trackId)
}(track.Id)
}
// wait until the connection is closed