Issue #2452 - Don't use WebVTTListener, JS wrapper, MediaShutdownManager in stable state

https://bugzilla.mozilla.org/show_bug.cgi?id=1443429
https://bugzilla.mozilla.org/show_bug.cgi?id=1515021
This commit is contained in:
Martok 2024-01-14 22:41:18 +01:00 committed by roytam1
commit fbd829908e
7 changed files with 77 additions and 38 deletions

View file

@ -602,6 +602,17 @@ void
TextTrackManager::TimeMarchesOn()
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
if (context && context->IsInStableOrMetaStableState()) {
// FireTimeUpdate can be called while at stable state following a
// current position change which triggered a state watcher in MediaDecoder
// (see bug 1443429).
// TimeMarchesOn() will modify JS attributes which is forbidden while in
// stable state. So we dispatch a task to perform such operation later
// instead.
DispatchTimeMarchesOn();
return;
}
WEBVTT_LOG("TimeMarchesOn");
mTimeMarchesOnDispatched = false;