зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1547381 - Call StopTrack() in the right order. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D29924 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5e6b519d3b
Коммит
a8cc07510f
|
@ -4596,22 +4596,26 @@ void GetUserMediaWindowListener::StopSharing() {
|
|||
void GetUserMediaWindowListener::StopRawID(const nsString& removedDeviceID) {
|
||||
MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread");
|
||||
|
||||
nsTArray<Pair<RefPtr<SourceListener>, TrackID>> matches;
|
||||
for (auto& source : mActiveListeners) {
|
||||
if (source->GetAudioDevice()) {
|
||||
nsString id;
|
||||
source->GetAudioDevice()->GetRawId(id);
|
||||
if (removedDeviceID.Equals(id)) {
|
||||
source->StopTrack(kAudioTrack);
|
||||
matches.AppendElement(MakePair(source, TrackID(kAudioTrack)));
|
||||
}
|
||||
}
|
||||
if (source->GetVideoDevice()) {
|
||||
nsString id;
|
||||
source->GetVideoDevice()->GetRawId(id);
|
||||
if (removedDeviceID.Equals(id)) {
|
||||
source->StopTrack(kVideoTrack);
|
||||
matches.AppendElement(MakePair(source, TrackID(kVideoTrack)));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (auto& pair : matches) {
|
||||
pair.first()->StopTrack(pair.second());
|
||||
}
|
||||
}
|
||||
|
||||
void GetUserMediaWindowListener::ChromeAffectingStateChanged() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче