DrainComplete() is called before all frames are output

RESOLVED FIXED in Firefox 42

Status

()

defect
P2
normal
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jya, Assigned: jya)

Tracking

({regression})

Trunk
mozilla43
Unspecified
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox42 fixed, firefox43 fixed)

Details

Attachments

(1 attachment)

This is a regression introduced by bug 1192675 and what caused bug 1198094 to be backed out.

When we drain the mac decoder; either the VDA or VT one ask the framework to drain its pending frames (VDA) or wait for async decoding to complete (VT).

This will cause the callback to be called with the drained frames.

Once we're done waiting for the drain in ProcessDrain() will immediately issue DrainComplete().

However, following bug 1192675, the decoder's callback queue a task for each drained frames . This task will only get to run once ProcessDrain() completes.

We should issue the DrainComplete() callback only once all the drained frames have been process in AppleVDADecoder::OutputFrame.
We ensure thread-safety by making OutputFrame thread-safe and extend the use of the monitor to protect mReorderQueue.
Ensuring that following a drain, no pending tasks were pending and doing the right thing was just too complicated, especially with a flushable taskqueue where none can guarantee a dispatched task will actually run.
Attachment #8653476 - Flags: review?(giles)
Assignee: nobody → jyavenard
Keywords: regression
Blocks: 1197083
Attachment #8653476 - Flags: review?(giles) → review+
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/81dd43b43784
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Backed out for a youtube playback regression. See Bug 1199573.
https://hg.mozilla.org/releases/mozilla-aurora/rev/5bb661db5c6c
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.