Fix assertion when only video or audio capture is selected (issue #1802)

This commit is contained in:
Marshall Greenblatt 2016-05-09 16:17:54 -04:00
parent 157f526d07
commit bff6dd684c
1 changed files with 14 additions and 11 deletions

View File

@ -2286,17 +2286,20 @@ void CefBrowserHostImpl::RequestMediaAccessPermission(
case content::MEDIA_ENUMERATE_DEVICES: case content::MEDIA_ENUMERATE_DEVICES:
// Pick the desired device or fall back to the first available of the // Pick the desired device or fall back to the first available of the
// given type. // given type.
CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( if (microphone_requested) {
request.requested_audio_device_id, CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice(
microphone_requested, request.requested_audio_device_id,
false, true,
&devices); false,
&devices);
CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( }
request.requested_video_device_id, if (webcam_requested) {
false, CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice(
webcam_requested, request.requested_video_device_id,
&devices); false,
true,
&devices);
}
break; break;
} }
} }