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

Commit 7e47f25f authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Improve error logging for getOutputSamplingRate"

parents 18a3609d b1bef51f
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -245,12 +245,14 @@ status_t AudioTrack::set(
        streamType = AUDIO_STREAM_MUSIC;
    }

    status_t status;
    if (sampleRate == 0) {
        uint32_t afSampleRate;
        if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
            return NO_INIT;
        status = AudioSystem::getOutputSamplingRate(&sampleRate, streamType);
        if (status != NO_ERROR) {
            ALOGE("Could not get output sample rate for stream type %d; status %d",
                    streamType, status);
            return status;
        }
        sampleRate = afSampleRate;
    }
    mSampleRate = sampleRate;

@@ -338,7 +340,7 @@ status_t AudioTrack::set(
    }

    // create the IAudioTrack
    status_t status = createTrack_l(streamType,
    status = createTrack_l(streamType,
                                  sampleRate,
                                  format,
                                  frameCount,