Bug 1522488 - Increase wait time before a new device enumeration after a device change event to avoid getting outdated list. r=padenot

The problem here is that the MediaStreamGraphImpl::mInputDeviceID is not reset after a device unplug. On a device-remove event of the active device MediaStreamGraphImpl::mInputDeviceID is reset when MediaStreamGraphImpl::CloseAudioInput is being executed. This method will not be executed if the new enumeration, on the MediaManager::OnDeviceChange, is returning the old outdated list of devices. This patch increases the wait time before the new enumeration in order to allow the system to update the provided device list.

Differential Revision: https://phabricator.services.mozilla.com/D17843

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Chronopoulos 2019-01-28 17:36:07 +00:00
Родитель bfbc7123b5
Коммит c7a3f72677
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -2192,7 +2192,7 @@ void MediaManager::OnDeviceChange() {
// On some Windows machine, if we call EnumerateRawDevices immediately
// after receiving devicechange event, sometimes we would get outdated
// devices list.
PR_Sleep(PR_MillisecondsToInterval(100));
PR_Sleep(PR_MillisecondsToInterval(200));
auto devices = MakeRefPtr<MediaDeviceSetRefCnt>();
self->EnumerateRawDevices(
0, MediaSourceEnum::Camera, MediaSourceEnum::Microphone,