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

Commit c2afbdf2 authored by Kevin Rocard's avatar Kevin Rocard
Browse files

Dynamic audio policy should reject non pcm



Test: adb shell audiorecorder --target /data/file.raw
Bug: 111453086
Change-Id: I4691b19b1fa2f3b8e8e5045c9ea5be0a5c9effb6
Signed-off-by: default avatarKevin Rocard <krocard@google.com>
parent c43ea147
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -951,8 +951,8 @@ status_t AudioPolicyManager::getOutputForAttrInt(


    // FIXME: in case of RENDER policy, the output capabilities should be checked
    // FIXME: in case of RENDER policy, the output capabilities should be checked
    if ((usePrimaryOutputFromPolicyMixes || !secondaryDescs->empty())
    if ((usePrimaryOutputFromPolicyMixes || !secondaryDescs->empty())
        && !audio_has_proportional_frames(config->format)) {
        && !audio_is_linear_pcm(config->format)) {
        ALOGW("%s: audio loopback only supports proportional frames", __func__);
        ALOGD("%s: rejecting request as dynamic audio policy only support pcm", __func__);
        return BAD_VALUE;
        return BAD_VALUE;
    }
    }
    if (usePrimaryOutputFromPolicyMixes) {
    if (usePrimaryOutputFromPolicyMixes) {