mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Don't honour NACKs if we're congested.
This commit is contained in:
parent
5a1ef1ddd7
commit
a74e4f68b5
1 changed files with 17 additions and 11 deletions
10
client.go
10
client.go
|
@ -608,10 +608,14 @@ func rtcpDownListener(g *group, conn *downConnection, track *downTrack, s *webrt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case *rtcp.TransportLayerNack:
|
case *rtcp.TransportLayerNack:
|
||||||
|
maxBitrate := track.maxBitrate.Get(msSinceEpoch())
|
||||||
|
bitrate := track.rate.Estimate()
|
||||||
|
if uint64(bitrate) < maxBitrate {
|
||||||
sendRecovery(p, track)
|
sendRecovery(p, track)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func trackKinds(down *downConnection) (audio bool, video bool) {
|
func trackKinds(down *downConnection) (audio bool, video bool) {
|
||||||
|
@ -720,7 +724,9 @@ func sendRecovery(p *rtcp.TransportLayerNack, track *downTrack) {
|
||||||
for _, nack := range p.Nacks {
|
for _, nack := range p.Nacks {
|
||||||
for _, seqno := range nack.PacketList() {
|
for _, seqno := range nack.PacketList() {
|
||||||
raw := track.remote.cache.Get(seqno)
|
raw := track.remote.cache.Get(seqno)
|
||||||
if raw != nil {
|
if raw == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
err := packet.Unmarshal(raw)
|
err := packet.Unmarshal(raw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
@ -728,11 +734,11 @@ func sendRecovery(p *rtcp.TransportLayerNack, track *downTrack) {
|
||||||
err = track.track.WriteRTP(&packet)
|
err = track.track.WriteRTP(&packet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("%v", err)
|
log.Printf("%v", err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
track.rate.Add(uint32(len(raw)))
|
track.rate.Add(uint32(len(raw)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func countMediaStreams(data string) (int, error) {
|
func countMediaStreams(data string) (int, error) {
|
||||||
|
|
Loading…
Reference in a new issue