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,
if (info->monitor_of_sink != PA_INVALID_INDEX)
return;
// Exclude devices that don't have an available active port (i.e it's
// unplugged). Such devices won't be picked (by pulseaudio) as default device,
// and if we have no available devices we don't want to add a default device
// to enumerations either.
if (!info->active_port ||
info->active_port->available == PA_PORT_AVAILABLE_NO)
return;
// If the device has ports, but none of them are available, skip it.
if (info->n_ports > 0) {
uint32_t port = 0;
for (; port != info->n_ports; ++port) {
if (info->ports[port]->available != PA_PORT_AVAILABLE_NO)
break;
}
if (port == info->n_ports)
return;
}
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