Commit 96352eba authored by Oskar Sundbom's avatar Oskar Sundbom Committed by Commit Bot

pulse: Only filter ported input devices with no available ports

Leave portless devices alone.

Bug: 853693, b/79580580
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I0e505b0f87fdb2b416ca080ad104ea6710e2ec6a
Reviewed-on: https://chromium-review.googlesource.com/1104433Reviewed-by: default avatarMax Morin <maxmorin@chromium.org>
Commit-Queue: Oskar Sundbom <ossu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568416}
parent b04339b7
...@@ -274,13 +274,16 @@ void AudioManagerPulse::InputDevicesInfoCallback(pa_context* context, ...@@ -274,13 +274,16 @@ void AudioManagerPulse::InputDevicesInfoCallback(pa_context* context,
if (info->monitor_of_sink != PA_INVALID_INDEX) if (info->monitor_of_sink != PA_INVALID_INDEX)
return; return;
// Exclude devices that don't have an available active port (i.e it's // If the device has ports, but none of them are available, skip it.
// unplugged). Such devices won't be picked (by pulseaudio) as default device, if (info->n_ports > 0) {
// and if we have no available devices we don't want to add a default device uint32_t port = 0;
// to enumerations either. for (; port != info->n_ports; ++port) {
if (!info->active_port || if (info->ports[port]->available != PA_PORT_AVAILABLE_NO)
info->active_port->available == PA_PORT_AVAILABLE_NO) break;
}
if (port == info->n_ports)
return; return;
}
manager->devices_->push_back(AudioDeviceName(info->description, info->name)); manager->devices_->push_back(AudioDeviceName(info->description, info->name));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment