send receiver reports only after receiving a sender report

This commit is contained in:
aler9
2021-12-06 17:09:59 +01:00
parent 8068b9b40e
commit 7634076eb5
6 changed files with 30 additions and 3 deletions

View File

@@ -52,10 +52,16 @@ func New(receiverSSRC *uint32, clockRate int) *RTCPReceiver {
}
// Report generates a RTCP receiver report.
// It returns nil if no RTCP sender reports have been passed to ProcessPacketRTCP yet.
func (rr *RTCPReceiver) Report(ts time.Time) []byte {
rr.mutex.Lock()
defer rr.mutex.Unlock()
var zero time.Time
if rr.lastSenderReportTime == zero {
return nil
}
report := &rtcp.ReceiverReport{
SSRC: rr.receiverSSRC,
Reports: []rtcp.ReceptionReport{