RESOLVED FIXED 203407
enumerateDevices() doesn't return correct list of devices after device was changed by user in a system preferences
https://bugs.webkit.org/show_bug.cgi?id=203407
Summary enumerateDevices() doesn't return correct list of devices after device was ch...
olsviate
Reported 2019-10-25 05:16:20 PDT
Steps to reproduce: 1. Have two or more available microphones 2. Call getUserMedia and then enumerateDevices: browser will return a list of devices, where first one is default 2. Change microphone is system preference 3. Call enumerateDevices again: first one in the list is a previous default device Js fiddler to show the issue: https://jsfiddle.net/h38bn7zq/15/ Note: if device is unplugged then enumerateDevices returns correct info, it works correct also when device was plugged in after.
Attachments
Patch (3.54 KB, patch)
2019-11-04 07:53 PST, Eric Carlson
no flags
Patch for landing. (3.35 KB, patch)
2019-11-04 08:10 PST, Eric Carlson
no flags
Radar WebKit Bug Importer
Comment 1 2019-10-26 13:12:22 PDT
youenn fablet
Comment 2 2019-10-26 13:17:57 PDT
I can repro the bug. On page reload, the default device is the correct one. There is apparently no device change event being fired, which means we either do not receive the notification or we do not detect any change in the device setup while we should.
Eric Carlson
Comment 3 2019-11-04 07:53:34 PST
youenn fablet
Comment 4 2019-11-04 07:58:49 PST
Comment on attachment 382738 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382738&action=review > Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:131 > + callOnMainThread([] { We probably do not need callOnMainThread since we ask the listener to be called on dispatch_get_main_queue.
Eric Carlson
Comment 5 2019-11-04 08:10:29 PST
Created attachment 382740 [details] Patch for landing.
WebKit Commit Bot
Comment 6 2019-11-04 08:42:38 PST
Comment on attachment 382740 [details] Patch for landing. Clearing flags on attachment: 382740 Committed r251992: <https://trac.webkit.org/changeset/251992>
WebKit Commit Bot
Comment 7 2019-11-04 08:42:40 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.