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

Commit c0b9c68e authored by Phil Burk's avatar Phil Burk Committed by android-build-merger
Browse files

Merge "AAudio should not use legacy path if not allowed" am: 07b09a79

am: 9a1d648e

Change-Id: Ibeb221f91a89509b21b05c8adc41b1c207df432b
parents 3edf24a2 9a1d648e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -272,7 +272,9 @@ public:
                    if (strlen(arg) > 2) {
                        policy = atoi(&arg[2]);
                    }
                    AAudio_setMMapPolicy(policy);
                    if (!AAudio_setMMapPolicy(policy)) {
                        printf("ERROR: invalid MMAP policy mode %i\n", policy);
                    }
                } break;
                case 'n':
                    setNumberOfBursts(atoi(&arg[2]));
@@ -363,7 +365,7 @@ public:
                mode = AAUDIO_PERFORMANCE_MODE_POWER_SAVING;
                break;
            default:
                printf("ERROR invalid performance mode %c\n", c);
                printf("ERROR: invalid performance mode %c\n", c);
                break;
        }
        return mode;
+5 −0
Original line number Diff line number Diff line
@@ -150,6 +150,11 @@ aaudio_result_t AudioStreamBuilder::build(AudioStream** streamPtr) {
        allowMMap = false;
    }

    if (!allowMMap && !allowLegacy) {
        ALOGE("%s() no backend available: neither MMAP nor legacy path are allowed", __func__);
        return AAUDIO_ERROR_ILLEGAL_ARGUMENT;
    }

    result = builder_createStream(getDirection(), sharingMode, allowMMap, &audioStream);
    if (result == AAUDIO_OK) {
        // Open the stream using the parameters from the builder.