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

Commit 37a466ae authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Fix copy/paste errors in use of AAUDIO_FORMAT_UNSPECIFIED

Bug: 62222736
Test: builds OK
Change-Id: Iabdac7a3d0893699eb72f85985002535c8f619c7
parent 629afae6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) {
    }

    // We have to do volume scaling. So we prefer FLOAT format.
    if (getFormat() == AAUDIO_UNSPECIFIED) {
    if (getFormat() == AAUDIO_FORMAT_UNSPECIFIED) {
        setFormat(AAUDIO_FORMAT_PCM_FLOAT);
    }
    // Request FLOAT for the shared mixer.
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder)
                        : builder.getBufferCapacity();

    // TODO implement an unspecified Android format then use that.
    audio_format_t format = (getFormat() == AAUDIO_UNSPECIFIED)
    audio_format_t format = (getFormat() == AAUDIO_FORMAT_UNSPECIFIED)
            ? AUDIO_FORMAT_PCM_FLOAT
            : AAudioConvert_aaudioToAndroidDataFormat(getFormat());

+2 −2
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ aaudio_result_t AAudioServiceStreamShared::open(const aaudio::AAudioStreamReques
    }

    mSampleRate = configurationInput.getSampleRate();
    if (mSampleRate == AAUDIO_FORMAT_UNSPECIFIED) {
    if (mSampleRate == AAUDIO_UNSPECIFIED) {
        mSampleRate = mServiceEndpoint->getSampleRate();
    } else if (mSampleRate != mServiceEndpoint->getSampleRate()) {
        ALOGE("AAudioServiceStreamShared::open(), mAudioFormat = %d, need %d",
@@ -85,7 +85,7 @@ aaudio_result_t AAudioServiceStreamShared::open(const aaudio::AAudioStreamReques
    }

    mSamplesPerFrame = configurationInput.getSamplesPerFrame();
    if (mSamplesPerFrame == AAUDIO_FORMAT_UNSPECIFIED) {
    if (mSamplesPerFrame == AAUDIO_UNSPECIFIED) {
        mSamplesPerFrame = mServiceEndpoint->getSamplesPerFrame();
    } else if (mSamplesPerFrame != mServiceEndpoint->getSamplesPerFrame()) {
        ALOGE("AAudioServiceStreamShared::open(), mSamplesPerFrame = %d, need %d",