Closed Bug 1229299 Opened 9 years ago Closed 9 years ago

StateMirroring/StateWatching calling the mirror callback out of order

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(1 file)

While investigating bug 1229256, I noticed that the WatchManager was calling MediaDecoder::UpdateReadyState with incorrect value.

The value I saw was first:
mNextFrameStatus = NEXT_FRAME_UNAVAILABLE
followed by another call with:
mNextFrameStatus = NEXT_FRAME_UNINITIALIZED

The first call being of the updated value of the mNextFrameStatus MDSM canonical, and the 2nd being the value set in the MDSM canonical constructor.

Upon investigation, the issue is that the first time the canonical's value is modified it dispatch a task using tail dispatch.
However, in the construction a standard task is dispatched.

As the tail dispatch is run first, we see the new updated value before the original value.
This ensures that tasks are run in the proper order.
Assignee: nobody → jyavenard
Attachment #8694071 - Flags: review?(bobbyholley)
Comment on attachment 8694071 [details] [diff] [review]
Use tail dispatch to notify the mirror of new value. r=bholley

Review of attachment 8694071 [details] [diff] [review]:
-----------------------------------------------------------------

Nice find!
Attachment #8694071 - Flags: review?(bobbyholley) → review+
https://hg.mozilla.org/mozilla-central/rev/f6e234ee862b
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
JW, do you think this should be uplifted?

AFAICT, purely looking at MediaDecoder, it would cause to not set up readyState to HAVE_FUTURE_DATA until playback starts.
there may be others as we're pretty reliant now on the StateMirror machinery to work
Flags: needinfo?(jwwang)
Sure. Uplift is preferred.
Flags: needinfo?(jwwang)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: