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

Commit 07b09a79 authored by Phil Burk's avatar Phil Burk Committed by Gerrit Code Review
Browse files

Merge "AAudio should not use legacy path if not allowed"

parents 3c5f3891 cc22cfb1
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.