mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1113086 - AudioChannel policy in Browser API - patch 4 - Muted by default, e=alwu
This commit is contained in:
parent
6b3d588724
commit
d4bc56bbad
@ -40,6 +40,9 @@ using namespace mozilla::hal;
|
||||
|
||||
namespace {
|
||||
|
||||
// If true, any new AudioChannelAgent will be muted when created.
|
||||
bool sAudioChannelMutedByDefault = false;
|
||||
|
||||
void
|
||||
NotifyChannelActive(uint64_t aWindowID, AudioChannel aAudioChannel,
|
||||
bool aActive)
|
||||
@ -169,6 +172,9 @@ AudioChannelService::AudioChannelService()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Preferences::AddBoolVarCache(&sAudioChannelMutedByDefault,
|
||||
"dom.audiochannel.mutedByDefault");
|
||||
}
|
||||
|
||||
AudioChannelService::~AudioChannelService()
|
||||
@ -825,6 +831,12 @@ AudioChannelService::ChildStatusReceived(uint64_t aChildID,
|
||||
data->mActiveContentOrNormalChannel = aContentOrNormalChannel;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
AudioChannelService::IsAudioChannelMutedByDefault()
|
||||
{
|
||||
return sAudioChannelMutedByDefault;
|
||||
}
|
||||
|
||||
/* static */ PLDHashOperator
|
||||
AudioChannelService::NotifyEnumerator(AudioChannelAgent* aAgent,
|
||||
AudioChannel* aAudioChannel,
|
||||
|
@ -48,6 +48,8 @@ public:
|
||||
*/
|
||||
static void Shutdown();
|
||||
|
||||
static bool IsAudioChannelMutedByDefault();
|
||||
|
||||
/**
|
||||
* Any audio channel agent that starts playing should register itself to
|
||||
* this service, sharing the AudioChannel.
|
||||
@ -146,7 +148,7 @@ private:
|
||||
{
|
||||
AudioChannelConfig()
|
||||
: mVolume(1.0)
|
||||
, mMuted(false)
|
||||
, mMuted(IsAudioChannelMutedByDefault())
|
||||
, mNumberOfAgents(0)
|
||||
{}
|
||||
|
||||
|
@ -4954,6 +4954,8 @@ pref("reader.toolbar.vertical", true);
|
||||
pref("media.gmp.insecure.allow", false);
|
||||
#endif
|
||||
|
||||
pref("dom.audiochannel.mutedByDefault", false);
|
||||
|
||||
// Use vsync aligned rendering. b2g prefs are in b2g.js.
|
||||
// Hardware vsync supported on windows, os x, and b2g.
|
||||
// Linux and fennec will use software vsync.
|
||||
|
Loading…
Reference in New Issue
Block a user