mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1044773 - the window can be null when AudioChannelAgent is created, r=roc
This commit is contained in:
parent
a5f10e8402
commit
2fb6da5400
@ -3895,6 +3895,11 @@ void HTMLMediaElement::UpdateAudioChannelPlayingState()
|
||||
if (playingThroughTheAudioChannel != mPlayingThroughTheAudioChannel) {
|
||||
mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;
|
||||
|
||||
// If we are not playing, we don't need to create a new audioChannelAgent.
|
||||
if (!mAudioChannelAgent && !mPlayingThroughTheAudioChannel) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mAudioChannelAgent) {
|
||||
nsresult rv;
|
||||
mAudioChannelAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1", &rv);
|
||||
|
@ -80,9 +80,6 @@ AudioChannelAgent::InitInternal(nsIDOMWindow* aWindow, int32_t aChannelType,
|
||||
nsIAudioChannelAgentCallback *aCallback,
|
||||
bool aUseWeakRef, bool aWithVideo)
|
||||
{
|
||||
// We need the window only for IPC.
|
||||
MOZ_ASSERT(aWindow || XRE_GetProcessType() == GeckoProcessType_Default);
|
||||
|
||||
// We syncd the enum of channel type between nsIAudioChannelAgent.idl and
|
||||
// AudioChannelBinding.h the same.
|
||||
MOZ_ASSERT(int(AUDIO_AGENT_CHANNEL_NORMAL) == int(AudioChannel::Normal) &&
|
||||
|
Loading…
Reference in New Issue
Block a user