Bug 1674283 - When a mic is already off, don't attempt to turn it off. r=pehrsons

Differential Revision: https://phabricator.services.mozilla.com/D97333
This commit is contained in:
Paul Adenot 2020-11-17 19:04:18 +00:00
Родитель ecb3d79e26
Коммит c416895d48
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -4464,9 +4464,9 @@ void SourceListener::SetMutedFor(LocalTrackSource* aTrackSource, bool aMute) {
} else {
aTrackSource->Unmute();
}
if (state.mOffWhileDisabled && !state.mDeviceEnabled &&
state.mDevice->mKind == dom::MediaDeviceKind::Videoinput) {
// Camera is already off. TODO: Revisit once we support UA-muting mics.
if (!state.mOffWhileDisabled || !state.mDeviceEnabled) {
// If the pref to turn the underlying device is itself off, or the device is
// already off, it's unecessary to do anything else.
return;
}
UpdateDevice(track, !aMute);