Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35a55961 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix remote submix input sharing

If two record clients are capturing from the same remote submix
device, attach them to the same input stream.

Bug: 358151598
Test: make
Flag: EXEMPT bug fix.
Change-Id: I4a7a14f92881c4106f6574e8a3c31eaf08588584
parent a079029b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3199,8 +3199,10 @@ audio_io_handle_t AudioPolicyManager::getInputForDevice(const sp<DeviceDescripto
        return input;
    }

    // Reuse an already opened input if a client with the same session ID already exists
    // on that input
    // Reuse an already opened input if:
    //  - a client with the same session ID already exists on that input
    //  - OR the requested device is a remote submix device with the same adrress
    //    as the one connected to that input
    for (size_t i = 0; i < mInputs.size(); i++) {
        sp <AudioInputDescriptor> desc = mInputs.valueAt(i);
        if (desc->mProfile != profile) {
@@ -3212,6 +3214,11 @@ audio_io_handle_t AudioPolicyManager::getInputForDevice(const sp<DeviceDescripto
                return desc->mIoHandle;
            }
        }
        if (audio_is_remote_submix_device(device->type())
                && (device->address() != "0")
                && device->equals(desc->getDevice())) {
            return desc->mIoHandle;
        }
    }

    bool isPreemptor = false;