Fix publisher loss reporting (#186)
This commit is contained in:
@@ -506,20 +506,21 @@ func (t *MediaTrack) sendDownTrackBindingReports(sub types.Participant) {
|
|||||||
|
|
||||||
func (t *MediaTrack) handlePublisherFeedback(packets []rtcp.Packet) {
|
func (t *MediaTrack) handlePublisherFeedback(packets []rtcp.Packet) {
|
||||||
var maxLost uint8
|
var maxLost uint8
|
||||||
var hasSenderReport bool
|
var hasReport bool
|
||||||
for _, p := range packets {
|
for _, p := range packets {
|
||||||
switch pkt := p.(type) {
|
switch pkt := p.(type) {
|
||||||
case *rtcp.SenderReport:
|
// sfu.Buffer generates ReceiverReports for the publisher
|
||||||
|
case *rtcp.ReceiverReport:
|
||||||
for _, rr := range pkt.Reports {
|
for _, rr := range pkt.Reports {
|
||||||
if rr.FractionLost > maxLost {
|
if rr.FractionLost > maxLost {
|
||||||
maxLost = rr.FractionLost
|
maxLost = rr.FractionLost
|
||||||
}
|
}
|
||||||
hasSenderReport = true
|
hasReport = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasSenderReport {
|
if hasReport {
|
||||||
t.fracLostLock.Lock()
|
t.fracLostLock.Lock()
|
||||||
if maxLost > t.maxUpFracLost {
|
if maxLost > t.maxUpFracLost {
|
||||||
t.maxUpFracLost = maxLost
|
t.maxUpFracLost = maxLost
|
||||||
|
|||||||
Reference in New Issue
Block a user