Do not propagate RTCP if report is not processed. (#2739)

This commit is contained in:
Raja Subramanian
2024-05-28 19:29:54 +05:30
committed by GitHub
parent fa65712a0e
commit 9781d30611
3 changed files with 16 additions and 13 deletions
+3 -2
View File
@@ -872,12 +872,13 @@ func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64) {
At: time.Now(),
}
didSet := false
if b.rtpStats != nil {
b.rtpStats.SetRtcpSenderReportData(srData)
didSet = b.rtpStats.SetRtcpSenderReportData(srData)
}
b.RUnlock()
if b.onRtcpSenderReport != nil {
if didSet && b.onRtcpSenderReport != nil {
b.onRtcpSenderReport()
}
}