webrtc-pc icon indicating copy to clipboard operation
webrtc-pc copied to clipboard

RTCDataChannel::onbuffereamountlow should trigger when threshold goes below buffered_amount

Open boivie opened this issue 3 years ago • 3 comments

Today the spec says:

bufferedAmountLowThreshold of type unsigned long ... When the bufferedAmount decreases from above this threshold to equal or below it, the bufferedamountlow event fires ...

Also:

[bufferamountlow] [Fired when...] The RTCDataChannel object's bufferedAmount decreases from above its bufferedAmountLowThreshold to less than or equal to its bufferedAmountLowThreshold.

It is reasonable to assume that also changing the bufferedAmountLowThreshold to a value that is above or equal to buffered_amount should trigger the event, if bufferedAmountLowThreshold was below buffered_amount before the change, as it would be the same transition.

With the current wording, the event will only be triggered when and only when the buffered_amount value decreases.

boivie avatar May 27 '21 10:05 boivie

Let me rephrase the core issue in my own words: "When bufferedAmountLowThreshold is being lowered, a check needs to be made whether the bufferedamountlow event needs to fire." Is that correct or is there more to it?

That would be a valid point. Then again, I think it's an ultra corner case and I doubt anyone ever ran into that. Still, correctness is key. :+1:

lgrahl avatar May 27 '21 11:05 lgrahl

What is the behavior of existing implementations?

alvestrand avatar May 27 '21 14:05 alvestrand

see also #1979

fippo avatar May 30 '21 05:05 fippo