Closed Bug 822952 Opened 12 years ago Closed 12 years ago

Avoid UpdateReadyState event queue traffic when the next frame status has not changed

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: kinetik, Assigned: kinetik)

References

Details

Attachments

(1 file)

While in the debugger I noticed a large number of calls to nsHTMLMediaElement::ChangeReadyState via UpdateReadyStateForData hitting the early-exit path because the ready state was not changing.  MediaDecoderStateMachine::UpdateReadyState is called from multiple places and dispatches an event each time, even if the state is unchanged.  This can result in many events being created and dispatched during a single video frame.

With a simple current == last status early-exit path added to MediaDecoderStateMachine::UpdateReadyState, the number of events created and dispatched for a simple play-through of a 5 minute video drops from ~140,000 (~468/s or ~15/frame) to 3.
Attached patch patch v0Splinter Review
Tests pass locally.  Try push: https://tbpl.mozilla.org/?tree=Try&rev=9c79c64b62d2
Attachment #693745 - Flags: review?(roc)
Comment on attachment 693745 [details] [diff] [review]
patch v0

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

Good catch
Attachment #693745 - Flags: review?(roc) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5f697a87ec46
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Blocks: 823168
Blocks: 495040
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: