Closed Bug 1740633 Opened 3 years ago Closed 2 years ago

[wpt-sync] Sync PR 31590 - MSE-in-Workers: Fix deadlock on duration reduction

Categories

(Core :: Audio/Video: Playback, task, P4)

task

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 31590 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/31590
Details from upstream follow.

Matt Wolenetz <wolenetz@chromium.org> wrote:

MSE-in-Workers: Fix deadlock on duration reduction

If MediaSourceInWorkers is enabled but MediaSourceNewAbortAndDuration is
not enabled, then when MediaSource duration is reduced, a deprecated
code path calls each SourceBuffer in the MediaSource to remove the media
that might potentially be truncated by the duration reduction. This
remove call itself took the same lock that is already held in the caller
in this case, causing unresponsive page due to double-lock on the
CrossThreadMediaSourceAttachment's lock.

This change calls Remove_Locked instead, since the preconditions checked
in SourceBuffer::remove are already enforced in
MediaSource::setDuration, and the double-lock is avoided.

This change also fixes a stray call to setting duration in a
MSE-in-Worker test to use the correct interface (though such call would
not have hit this double-lock on bots since those bots enable all
experimental web platform features.)

BUG=1268614,878133
TEST=manually confirmed repro fixed locally

Change-Id: I1a144cdab9bae5f66b6e1137c2b275c392c12023
Reviewed-on: https://chromium-review.googlesource.com/3274133
WPT-Export-Revision: 85e93cc54d0c92bd73f175a16551cb94eeb14b5d

Component: web-platform-tests → Audio/Video: Playback
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 1 subtests

Status Summary

Firefox

OK : 2
PASS: 1
FAIL: 2

Chrome

OK : 2
PASS: 6

Safari

OK : 2
PASS: 1
FAIL: 2

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/media-source/dedicated-worker/mediasource-worker-objecturl.html
Test main context revocation of DedicatedWorker MediaSource object URL: FAIL (Chrome: PASS, Safari: FAIL)
/media-source/dedicated-worker/mediasource-worker-play.html
Test worker MediaSource construction, attachment, buffering and basic playback: FAIL (Chrome: PASS, Safari: FAIL)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0de0c5324332
[wpt PR 31590] - MSE-in-Workers: Fix deadlock on duration reduction, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.