Disable audio loss proxying. (#2629)
* Disable audio loss proxying. Added a config which is off by default. With audio NACKs, that is the preferred repair mechanism. With RED, repair is built in via packet redundancy to recover from isolated losses. So, proxying is not required. But, leaving it in there with a config that is disabled by default. * fix test
This commit is contained in:
@@ -93,9 +93,10 @@ type Buffer struct {
|
||||
latestTSForAudioLevelInitialized bool
|
||||
latestTSForAudioLevel uint32
|
||||
|
||||
twcc *twcc.Responder
|
||||
audioLevelParams audio.AudioLevelParams
|
||||
audioLevel *audio.AudioLevel
|
||||
twcc *twcc.Responder
|
||||
audioLevelParams audio.AudioLevelParams
|
||||
audioLevel *audio.AudioLevel
|
||||
enableAudioLossProxying bool
|
||||
|
||||
lastPacketRead int
|
||||
|
||||
@@ -182,6 +183,13 @@ func (b *Buffer) SetAudioLevelParams(audioLevelParams audio.AudioLevelParams) {
|
||||
b.audioLevelParams = audioLevelParams
|
||||
}
|
||||
|
||||
func (b *Buffer) SetAudioLossProxying(enable bool) {
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
|
||||
b.enableAudioLossProxying = enable
|
||||
}
|
||||
|
||||
func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapability) {
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
@@ -824,7 +832,12 @@ func (b *Buffer) buildReceptionReport() *rtcp.ReceptionReport {
|
||||
return nil
|
||||
}
|
||||
|
||||
return b.rtpStats.GetRtcpReceptionReport(b.mediaSSRC, b.lastFractionLostToReport, b.rrSnapshotId)
|
||||
proxyLoss := b.lastFractionLostToReport
|
||||
if b.codecType == webrtc.RTPCodecTypeAudio && !b.enableAudioLossProxying {
|
||||
proxyLoss = 0
|
||||
}
|
||||
|
||||
return b.rtpStats.GetRtcpReceptionReport(b.mediaSSRC, proxyLoss, b.rrSnapshotId)
|
||||
}
|
||||
|
||||
func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64) {
|
||||
|
||||
Reference in New Issue
Block a user