Closed Bug 1726061 Opened 2 months ago Closed 2 months ago

Make `mLiveBufferingAppended` optional

Categories

(Core :: WebRTC: Audio/Video, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

Details

Attachments

(1 file, 1 obsolete file)

It seems mLiveBufferingAppended [1] should only be used when mLiveFramesAppended [2] is true. If the guess is right, then mLiveBufferingAppended can be wrapped by a Maybe naturally when mLiveBufferingAppended needs to be set, instead of using a boolean value indicating if we should use it.

By doing so, we can prevent mLiveBufferingAppended from being misused. Now we have several lines calling mLiveBufferingAppended without checking mLiveFramesAppended (so it becomes hard to see if mLiveBufferingAppended should ONLY be used when mLiveFramesAppended is set) [3]. We should take care of those lines as well.

[1] https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/dom/media/webrtc/MediaEngineWebRTCAudio.h#236
[2] https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/dom/media/webrtc/MediaEngineWebRTCAudio.h#230
[3] https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#850,864

Severity: -- → S4
Priority: -- → P1

mLiveBufferingAppended [1] can be wrapped by a Maybe naturally since
it should only be used when mLiveFramesAppended [2] is true. It's
easier to make sure mLiveBufferingAppended be used in a reasonable
timing by doing so, instead of checking mLiveFramesAppended every time
before using mLiveBufferingAppended.

[1] https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/dom/media/webrtc/MediaEngineWebRTCAudio.h#236
[2] https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/dom/media/webrtc/MediaEngineWebRTCAudio.h#230

Assignee: nobody → cchang

mLiveBufferingAppended [1] can be wrapped by a Maybe naturally since
it should only be used when mLiveFramesAppended [2] is true. It's
easier to make sure mLiveBufferingAppended be used in a reasonable
timing by doing so, instead of checking mLiveFramesAppended every time
before using mLiveBufferingAppended.

[1] https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/dom/media/webrtc/MediaEngineWebRTCAudio.h#236
[2] https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/dom/media/webrtc/MediaEngineWebRTCAudio.h#230

Attachment #9236549 - Attachment is obsolete: true
Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eb3bb3f30008
Make mLiveBufferingAppended optional r=padenot,pehrsons
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.