Closed Bug 1199193 Opened 9 years ago Closed 9 years ago

DrainComplete() is called before all frames are output

Categories

(Core :: Audio/Video: Playback, defect, P2)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox42 --- fixed
firefox43 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

(Keywords: regression)

Attachments

(1 file)

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
Status: NEW → RESOLVED
Closed: 9 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: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: