mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 815492 - Pause Web Audio playback when entering the bfcache, and resume it when coming out of the bfcache; r=bzbarsky
This commit is contained in:
parent
7f1add90db
commit
e9e1b63618
@ -197,5 +197,17 @@ AudioContext::CurrentTime() const
|
||||
return MediaTimeToSeconds(Destination()->Stream()->GetCurrentTime());
|
||||
}
|
||||
|
||||
void
|
||||
AudioContext::Suspend()
|
||||
{
|
||||
DestinationStream()->ChangeExplicitBlockerCount(1);
|
||||
}
|
||||
|
||||
void
|
||||
AudioContext::Resume()
|
||||
{
|
||||
DestinationStream()->ChangeExplicitBlockerCount(-1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -69,6 +69,9 @@ public:
|
||||
mDecoder.Shutdown();
|
||||
}
|
||||
|
||||
void Suspend();
|
||||
void Resume();
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope) MOZ_OVERRIDE;
|
||||
|
||||
static already_AddRefed<AudioContext>
|
||||
|
@ -10870,6 +10870,11 @@ nsGlobalWindow::SuspendTimeouts(uint32_t aIncrease,
|
||||
t->Release();
|
||||
}
|
||||
}
|
||||
|
||||
// Suspend all of the AudioContexts for this window
|
||||
for (uint32_t i = 0; i < mAudioContexts.Length(); ++i) {
|
||||
mAudioContexts[i]->Suspend();
|
||||
}
|
||||
}
|
||||
|
||||
// Suspend our children as well.
|
||||
@ -10926,6 +10931,11 @@ nsGlobalWindow::ResumeTimeouts(bool aThawChildren)
|
||||
}
|
||||
EnableGamepadUpdates();
|
||||
|
||||
// Resume all of the AudioContexts for this window
|
||||
for (uint32_t i = 0; i < mAudioContexts.Length(); ++i) {
|
||||
mAudioContexts[i]->Resume();
|
||||
}
|
||||
|
||||
// Resume all of the workers for this window.
|
||||
nsIScriptContext *scx = GetContextInternal();
|
||||
AutoPushJSContext cx(scx ? scx->GetNativeContext() : nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user